Replies: 1 comment 4 replies
-
Not the prettiest solution, but moving the alternation up a level and adding a quantification operator to the
Playground screenshot to demonstrate the captures: |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to match functions that have either multiple one_line comments or one multi_line comment as immediate preceding sibling nodes. Given the query below, this almost works. Namely, the query matches only the first one_line comment above the function. I tried adding a quantification operator to the alternation (
[(comment)+ (multiline_comment)] @comment
), but it doesn't work.Any alternative ideas on how to approach this problem?
So, given the following code below I'd like to match:
testModelPropertyWrapper
with both one_line commentstestSomething
with its multi_line commenttestMePlease
should not be matchedBeta Was this translation helpful? Give feedback.
All reactions