What's purpose of grammars and queries under runtime path? #4345
-
Just curious about it. I'm not familiar with tree-sitter at all. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The objects under These are in the runtime directory and not compiled directly into Helix because they would bloat the Helix binary a lot and be immutable - you would need to recompile Helix in order to add new language support. Helix can work without these but all languages effectively become plaintext (other than LSP features). |
Beta Was this translation helpful? Give feedback.
The objects under
runtime/grammars
are compiled C/C++ tree-sitter parsers. Helix uses them to parse documents and then uses the tree-sitter queries underruntime/queries
to query the parsed syntax trees to perform syntax highlighting or determine textobjects or custom auto-indent behavior.These are in the runtime directory and not compiled directly into Helix because they would bloat the Helix binary a lot and be immutable - you would need to recompile Helix in order to add new language support.
Helix can work without these but all languages effectively become plaintext (other than LSP features).