Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'book/src/guides/adding_languages.md')
-rw-r--r--book/src/guides/adding_languages.md15
1 files changed, 9 insertions, 6 deletions
diff --git a/book/src/guides/adding_languages.md b/book/src/guides/adding_languages.md
index f9824215..b92af402 100644
--- a/book/src/guides/adding_languages.md
+++ b/book/src/guides/adding_languages.md
@@ -1,4 +1,4 @@
-## Adding new languages to Helix
+# Adding new languages to Helix
In order to add a new language to Helix, you will need to follow the steps
below.
@@ -9,14 +9,13 @@ below.
necessary configuration for the new language. For more information on
language configuration, refer to the
[language configuration section](../languages.md) of the documentation.
- A new language server can be added by extending the `[language-server]` table in the same file.
2. If you are adding a new language or updating an existing language server
configuration, run the command `cargo xtask docgen` to update the
[Language Support](../lang-support.md) documentation.
> 💡 If you are adding a new Language Server configuration, make sure to update
> the
-> [Language Server Wiki](https://github.com/helix-editor/helix/wiki/Language-Server-Configurations)
+> [Language Server Wiki](https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers)
> with the installation instructions.
## Grammar configuration
@@ -34,9 +33,14 @@ below.
2. Create a new directory for the language with the path
`runtime/queries/<name>/`.
3. Refer to the
- [tree-sitter website](https://tree-sitter.github.io/tree-sitter/3-syntax-highlighting.html#highlights)
+ [tree-sitter website](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#queries)
for more information on writing queries.
-4. A list of highlight captures can be found [on the themes page](https://docs.helix-editor.com/themes.html#scopes).
+
+> 💡 In Helix, the first matching query takes precedence when evaluating
+> queries, which is different from other editors such as Neovim where the last
+> matching query supersedes the ones before it. See
+> [this issue](https://github.com/helix-editor/helix/pull/1170#issuecomment-997294090)
+> for an example.
## Common issues
@@ -46,4 +50,3 @@ below.
grammars.
- If a parser is causing a segfault, or you want to remove it, make sure to
remove the compiled parser located at `runtime/grammars/<name>.so`.
-- If you are attempting to add queries and Helix is unable to locate them, ensure that the environment variable `HELIX_RUNTIME` is set to the location of the `runtime` folder you're developing in.