<buttonid="sidebar-toggle"class="icon-button"type="button"title="Toggle Table of Contents"aria-label="Toggle Table of Contents"aria-controls="sidebar">
<ahref="../print.html"title="Print this book"aria-label="Print this book">
<iid="print-button"class="fa fa-print"></i>
</a>
</div>
</div>
<divid="search-wrapper"class="hidden">
<formid="searchbar-outer"class="searchbar-outer">
<inputtype="search"name="search"id="searchbar"name="searchbar"placeholder="Search this book ..."aria-controls="searchresults-outer"aria-describedby="searchresults-header">
<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>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>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>
<tr><td>comment-token</td><td>The token to use as a comment-token</td></tr>
<tr><td>indent</td><td>The indent to use. Has sub keys <code>tab-width</code> and <code>unit</code></td></tr>
<tr><td>config</td><td>Language server configuration</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>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>
</li>
<li>
<p>If a parser is segfaulting or you want to remove the parser, make sure to remove the submodule <em>and</em> the compiled parser in <code>runtime/grammar/<name>.so</code></p>
</li>
<li>
<p>The indents query is <code>indents.toml</code>, <em>not</em><code>indents.scm</code>. See <ahref="https://github.com/helix-editor/helix/issues/114">this</a> issue for more information.</p>