Closed harish-prakash closed 2 months ago
It's a supertype, they're hidden just like if you were to prepend a rule name with an underscore: https://tree-sitter.github.io/tree-sitter/creating-parsers#the-grammar-dsl
Then how come declaration
, another supertype which is hidden in the tree, work 🤔?
You're right, I was thinking about inlined rules in the context of a query, since statement is also inlined, which is weird an doesn't make sense. I'll un-inline it and update this grammar as well
Did you check existing issues?
Tree-Sitter CLI Version, if relevant (output of
tree-sitter --version
)No response
Describe the bug
I'm trying to capture every kind of statement using the
statement
node but it fails.I'm using the treesitter-playground from https://tree-sitter.github.io/tree-sitter/playground
Steps To Reproduce/Bad Parse Tree
Here is the sample code
Here is the generated tree
I'm trying to query it with
Expected Behavior/Parse Tree
I expect it to highlight the
import_statement
and thelexical_declaration
nodes because of the parser definition in tree-sitter-javascript/.../node-types.json (which is imported in typescript parser)Unfortunately, it does not. However, when I use
(declaration) @something
, then it highlights thelexical_declaration
node and when I use(import_statement) @something
then it highlights theimport_statement
node.Repro
No response