Replies: 1 comment 5 replies
-
I don't have a whole lot of helpful bits to contribute, but FWIW:
The docs here suggest that using more than one capture name with a predicate is supposed to work, but it's not clear to me whether a capture name from one pattern is supposed to work inside another pattern. (But note the point above about the predicates being "per-binding".) |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It is somewhat linked to #981
For context, I put everything in that Gist with a screenshot, a repro, and everything: https://gist.github.com/gagbo/f9e9ff04633391408064068356bca4c6
Since I can't match elements at any nested level, I'm trying to make a query with 2 patterns, where the first pattern detects an import name ("autometrics"), and the second pattern only matches nodes based on that first pattern detection.
Currently when I'm trying the pattern, I get a false positive (on line 7 of the sample code), where the name of the function in the
call_expression
doesn't match the name that got saved in the earlier pattern.Is there something I'm missing to make this work, or am I obligated to run this as 2 separate query steps ? (with templating to fill the second query with the result of the first)
Beta Was this translation helpful? Give feedback.
All reactions