tree-sitter-rust
tree-sitter-rust copied to clipboard
query with + operation did not work to capture more than one node
trafficstars
query with + operation did not work to capture more than one node. example code in rust
struct a{c: usize, b: usize}
what work ?
with query
(field_declaration_list
(field_declaration
(field_identifier) @field
(primitive_type)
)
(field_declaration
(field_identifier) @field
(primitive_type)
)
)
will get result 2 "(identifier)"
what did not work ?
(field_declaration_list
(field_declaration
(field_identifier) @field
(primitive_type)
)+
)
will get me only the first identifier
What the expectation ?
expect to get all identifier (2 in this case)
I also try to replicate this query in playground https://tree-sitter.github.io/tree-sitter/playground but not sure how it work, after I type query in the text box then what should I do next ?