nvim-treesitter / nvim-treesitter/nvim-treesitter-textobjects
Suggestion: Node Text Object
Nobody has claimed this yet.
- Dominant language
- Tree-sitter Query
- Stars
- 2.8k
- Forks
- 271
- Avg merge
- 8d 8h
- Merged PRs (30d)
- 1
Description
Is your feature request related to a problem? Please describe.
Rather generic text objects also seem to be useful, I use statement or block surprisingly often. I was thinking, that a simply text object "node" might be a nice addition to those.
Describe the solution you'd like
A node text object, which is the "smallest" node treesitter can recognize. For example, inner node would be a string without quotation marks, and outer node would be a node with quotation marks.
Describe alternatives you've considered
Creating a custom text object with a plugin like mini.ai, but that does not achieve the level of genericness required for this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests; start by locating the existing statement and block text objects and their Tree-sitter query entry points. Clarify how inner and outer node boundaries should work across node types, then add coverage showing the proposed node text object selects the intended ranges.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, neovim
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100