-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Querying at different parts of the tree gives inconsistent results #2043
Comments
+1 on this problem |
It's impacting me too. |
When you explore the tree with the cursor you can reach nodes that aren't printed out when you print the tree. Can you print out all the child nodes you can programmatically find from the parent of the node from which you execute the second query? So all the node's siblings. |
I added the following code: TSNode call_parent = ts_node_parent(call_node);
printf("parent: %s\n", ts_node_string(call_parent));
for (int i = 0; i < ts_node_child_count(call_parent); i++) {
printf("node %d: %s\n", i, ts_node_string(ts_node_child(call_parent, i)));
} And it outputs only this:
|
seems like this was fixed in #3191, sorry for not noticing earlier |
I'm trying to run a query at a non-root node and it isn't matching. When I run the same query at the root it works correctly.
This seems to have something to do with the (Ruby) grammar containing a hidden rule. Due to the inconsistency, I assume this is an issue with Tree Sitter itself, rather than the grammar.
Example code:
Expected output:
Actual output:
The text was updated successfully, but these errors were encountered: