smacker/go-tree-sitter

Why do I need to call FilterPredicates to apply the predicates?

rstcruzo opened this issue · 0 comments

I expected that NextMatch would return the nodes that match the predicates. Instead, it returns all the nodes and I have to manually filter the nodes by calling FilterPredicates and checking if QueryMatch.Captures is empty or not.

The tree-sitter-cli searches for the nodes and applies the predicates at once. It prints only the nodes that match the predicates.