To add a new language, you need to add a
[[language]] entry to the
languages.toml (see the language configuration section).
When adding a new language or Language Server configuration for an existing
cargo xtask docgen to add the new configuration to the
Language Support docs before creating a pull request.
When adding a Language Server configuration, be sure to update the
Language Server Wiki with installation notes.
If a tree-sitter grammar is available for the language, add a new
You may use the
source.path key rather than
source.git with an absolute path
to a locally available grammar for testing, but switch to
submitting a pull request.
For a language to have syntax-highlighting and indentation among
other things, you have to add queries. Add a directory for your
language with the path
runtime/queries/<name>/. The tree-sitter
gives more info on how to write queries.
NOTE: When evaluating queries, the first matching query takes precedence, which is different from other editors like neovim where the last matching query supersedes the ones before it. See this issue for an example.
If you get errors when running after switching branches, you may have to update the tree-sitter grammars. Run
hx --grammar fetchto fetch the grammars and
hx --grammar buildto build any out-of-date grammars.
If a parser is segfaulting or you want to remove the parser, make sure to remove the compiled parser in