Adding tags queries
See tree-sitter's documentation on Code Navigation Systems for more background on tags queries.
Helix provides LSP-like features such as document and workspace symbol pickers
out-of-the-box for languages with tags.scm
queries based on syntax trees. To
be analyzed a language must have a tree-sitter grammar and a tags.scm
query
file which pattern matches interesting nodes from syntax trees.
Query files should be placed in runtime/queries/{language}/tags.scm
when contributing to Helix. You may place these under your local runtime
directory (~/.config/helix/runtime
in Linux for example) for the sake of
testing.
The following captures are recognized:
Capture name |
---|
definition.class |
definition.constant |
definition.function |
definition.interface |
definition.macro |
definition.module |
definition.struct |
definition.type |
Example query files can be found in the Helix GitHub repository.