Skip to content
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

Add #make-range-between! #608

Open
alexmozaidze opened this issue Apr 24, 2024 · 0 comments
Open

Add #make-range-between! #608

alexmozaidze opened this issue Apr 24, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@alexmozaidze
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Currently, creating a range between nodes requires intermediate nodes that are inside what you selected:

((sequence_arguments
   .
   (_) @_start
   (_) @_end
   .
   ")" .)
 (#make-range! "parameter.outer" @_start @_end))

And if the behaviour also changes depending on how many elements there are in sequence_arguments, you must add several more queries that take this into account, which is extremely annoying and prone to mistakes.

Describe the solution you'd like

Add a new #make-range-between! directive, that creates a range that captures everything between @_start and @_end.

Instead of taking range (capture1.start)..(capture2.end) like #make-range! does, it would take (capture1.end)..(capture2.start).

This would allow creating queries to capture things inside something much, much easier!

Describe alternatives you've considered

_

Additional context

_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant