Skip to content

Duplicate Captures #2586

Closed Answered by ahlinc
MixusMinimax asked this question in Q&A
Aug 28, 2023 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

The result using the rust cli
Result using web-tree-sitter

Don't mix captures and matches modes, that was the main mistake.

Your original issue reproducible with CLI so it's not a bug in the web binding:

In the matches mode your original query works as you expected:

You need to properly construct your queries, on the bellow screenshot there are fixed queries for both captures and matches modes. Keep in mind that queries for the matches mode may not work well for the captures mode. Also be attentive when you use underscore placeholders, usually it's better to use explicit node names and especially for string literal terminals.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@ahlinc
Comment options

@MixusMinimax
Comment options

Comment options

You must be logged in to vote
1 reply
@MixusMinimax
Comment options

Answer selected by MixusMinimax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants