<p>Next, you need to add the language to the <code>languages.toml</code> found in the root of the repository; this <code>languages.toml</code> file is included at compilation time, and is distinct from the <code>language.toml</code> file in the user's <ahref="../configuration.html">configuration directory</a>.</p>
<p>Next, you need to add the language to the <ahref="https://github.com/helix-editor/helix/blob/master/languages.toml"><code>languages.toml</code></a> found in the root of
the repository; this <code>languages.toml</code> file is included at compilation time, and
is distinct from the <code>language.toml</code> file in the user's <ahref="../configuration.html">configuration
directory</a>.</p>
<p>These are the available keys and descriptions for the file.</p>
<tr><td>name</td><td>The name of the language</td></tr>
<tr><td>scope</td><td>A string like <code>source.js</code> that identifies the language. Currently, we strive to match the scope names used by popular TextMate grammars and by the Linguist library. Usually <code>source.<name></code> or <code>text.<name></code> in case of markup languages</td></tr>
<tr><td>injection-regex</td><td>regex pattern that will be tested against a language name in order to determine whether this language should be used for a potential language injection site. <ahref="https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection">link</a></td></tr>
<tr><td>injection-regex</td><td>regex pattern that will be tested against a language name in order to determine whether this language should be used for a potential <ahref="https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection">language injection</a> site.</td></tr>
<tr><td>file-types</td><td>The filetypes of the language, for example <code>["yml", "yaml"]</code></td></tr>
<tr><td>roots</td><td>A set of marker files to look for when trying to find the workspace root. For example <code>Cargo.lock</code>, <code>yarn.lock</code></td></tr>
<tr><td>auto-format</td><td>Whether to autoformat this language when saving</td></tr>
@ -167,11 +171,11 @@
<p>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 <code>runtime/queries/<name>/</code>. The tree-sitter <ahref="https://tree-sitter.github.io/tree-sitter/syntax-highlighting#queries">website</a> gives more info on how to write queries.</p>
<li>If you get errors when building after switching branches, you may have to remove or update tree-sitter submodules. You can update submodules by running</li>
<p>If you get errors when building after switching branches, you may have to remove or update tree-sitter submodules. You can update submodules by running</p>
<p>Make sure to not use the <code>--remote</code> flag. To remove submodules look inside the <code>.gitmodules</code> and remove directories that are not present inside of it.</p>
require an accompanying tree-sitter grammar and a <code>textobjects.scm</code> query file
to work properly. Tree-sitter allows us to query the source code syntax tree
and capture specific parts of it. The queries are written in a lisp dialect.
More information on how to write queries can be found in the <ahref="tree-sitter-queries">official tree-sitter
More information on how to write queries can be found in the <ahref="https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax">official tree-sitter
documentation</a>.</p>
<p>Query files should be placed in <code>runtime/queries/{language}/textobjects.scm</code>
when contributing. Note that to test the query files locally you should put
<p>Next, you need to add the language to the <code>languages.toml</code> found in the root of the repository; this <code>languages.toml</code> file is included at compilation time, and is distinct from the <code>language.toml</code> file in the user's <ahref="guides/../configuration.html">configuration directory</a>.</p>
<p>Next, you need to add the language to the <ahref="https://github.com/helix-editor/helix/blob/master/languages.toml"><code>languages.toml</code></a> found in the root of
the repository; this <code>languages.toml</code> file is included at compilation time, and
is distinct from the <code>language.toml</code> file in the user's <ahref="guides/../configuration.html">configuration
directory</a>.</p>
<p>These are the available keys and descriptions for the file.</p>
<tr><td>name</td><td>The name of the language</td></tr>
<tr><td>scope</td><td>A string like <code>source.js</code> that identifies the language. Currently, we strive to match the scope names used by popular TextMate grammars and by the Linguist library. Usually <code>source.<name></code> or <code>text.<name></code> in case of markup languages</td></tr>
<tr><td>injection-regex</td><td>regex pattern that will be tested against a language name in order to determine whether this language should be used for a potential language injection site. <ahref="https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection">link</a></td></tr>
<tr><td>injection-regex</td><td>regex pattern that will be tested against a language name in order to determine whether this language should be used for a potential <ahref="https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection">language injection</a> site.</td></tr>
<tr><td>file-types</td><td>The filetypes of the language, for example <code>["yml", "yaml"]</code></td></tr>
<tr><td>roots</td><td>A set of marker files to look for when trying to find the workspace root. For example <code>Cargo.lock</code>, <code>yarn.lock</code></td></tr>
<tr><td>auto-format</td><td>Whether to autoformat this language when saving</td></tr>
<p>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 <code>runtime/queries/<name>/</code>. The tree-sitter <ahref="https://tree-sitter.github.io/tree-sitter/syntax-highlighting#queries">website</a> gives more info on how to write queries.</p>
<li>If you get errors when building after switching branches, you may have to remove or update tree-sitter submodules. You can update submodules by running</li>
<p>If you get errors when building after switching branches, you may have to remove or update tree-sitter submodules. You can update submodules by running</p>
<p>Make sure to not use the <code>--remote</code> flag. To remove submodules look inside the <code>.gitmodules</code> and remove directories that are not present inside of it.</p>
require an accompanying tree-sitter grammar and a <code>textobjects.scm</code> query file
to work properly. Tree-sitter allows us to query the source code syntax tree
and capture specific parts of it. The queries are written in a lisp dialect.
More information on how to write queries can be found in the <ahref="guides/tree-sitter-queries">official tree-sitter
More information on how to write queries can be found in the <ahref="https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax">official tree-sitter
documentation</a>.</p>
<p>Query files should be placed in <code>runtime/queries/{language}/textobjects.scm</code>
when contributing. Note that to test the query files locally you should put