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
Query only matches first node at field #2984
Comments
11 tasks
Please try the latest version (0.20.9). |
can reproduce on 0.20.9 & master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
If the same field is used for multiple child nodes, a query will only match the first node
Steps to reproduce
Inputs
test.elm
Its parse tree is as follows:
Note how there are two nodes with field
pattern
test.scm
Actual output
➜ npx tree-sitter query test.scm test.elm ../../../test.elm pattern: 0 capture: 0 - argumentOrParameter, start: (0, 2), end: (0, 3), text: `x`
Expected behavior
I'd expect matches for both
x
andy
:Tree-sitter version (tree-sitter --version)
tree-sitter 0.20.6 (ccd6bf5)
Operating system/version
macOS 14.3 (23D56)
The text was updated successfully, but these errors were encountered: