nvim-treesitter / nvim-treesitter/nvim-treesitter-textobjects
Specify if query selects last line or not
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.
I want to create a query for C for inner block
Query
(compound_statement
.
"{"
.
(_) @_start @_end
(_)? @_end
.
"}"
(#make-range! "block.inner" @_start @_end))
I have
I want
If the block is a function it works though
Describe the solution you'd like
I do not know if it's treesitter the problem or this package. I don't know the intricacies of treesitter so I'm unsure where to post or what the solution should be.
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
Start by reproducing the C inner-block query from the issue and compare its behavior with the function-block case. Read the Tree-sitter query and nvim-treesitter-textobjects behavior to determine whether selecting the last line belongs to Tree-sitter or this package; done means the ownership and expected selection semantics are established.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100