-
-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Labels
Description
Did you check existing issues?
- I have read all the tree-sitter docs if it relates to using the parser
- I have searched the existing issues of tree-sitter-rust
Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)
tree-sitter 0.25.8
Describe the bug
Since 2168ab9, tree-sitter-rust declares some supertypes. From my understanding of query syntax docs, we should now be able to write a simple query like (_declaration_statement) which will then match any sub-types, like enum_item or function_item.
However that doesn't work from me. I tried with nvim EditQuery and with python bindings Query(). In both cases I get an error "Invalid node type "_declaration_statement". How is this meant to work?
Just close if it's not a bug. I'm only learning about this and may have misunderstandings.
Steps To Reproduce/Bad Parse Tree
- Install tree-sitter-rust as .config/nvim/parser/rust.so
- Write a file test.rs in nvim, open query editor with
:EditQuery - enter
(function_item)- no error - enter
(_declaration_statement)- Invalid node type "_declaration_statement"
Expected Behavior/Parse Tree
Query is accepted and works as described in query syntax docs.
Repro
// (_declaration_statement) should match for sub type function_item
fn foo() {}