Is your feature request related to a problem? Please describe.
When debugging the formatting queries, it is very difficult to understand which rules are being applied to some subtree. If rules could be given names, which are spewed out in the debug output, that should make things a lot easier.
Describe the solution you'd like
Perhaps using predicates, something like:
Using names should be encouraged, but not mandatory. If no name is given for a rule, then one could be generated (e.g., queries/my-language.scm:L20-25).
Additional context
Given names must be unique and query parsing should probably fail when this isn't true.
In the debug output there are pattern_index values when there's a match. Presumably these are 0-based in the order in which they appear in the query file.
Is your feature request related to a problem? Please describe. When debugging the formatting queries, it is very difficult to understand which rules are being applied to some subtree. If rules could be given names, which are spewed out in the debug output, that should make things a lot easier.
Describe the solution you'd like Perhaps using predicates, something like:
Using names should be encouraged, but not mandatory. If no name is given for a rule, then one could be generated (e.g.,
queries/my-language.scm:L20-25
).Additional context Given names must be unique and query parsing should probably fail when this isn't true.