mirror of https://github.com/helix-editor/helix
deploy: 8b952bb1d5
parent
ceac60d3b7
commit
e589fbb298
|
@ -164,10 +164,14 @@
|
||||||
<p>Writing language injection queries allows one to highlight a specific node as a different language.
|
<p>Writing language injection queries allows one to highlight a specific node as a different language.
|
||||||
In addition to the <a href="https://tree-sitter.github.io/tree-sitter/3-syntax-highlighting.html#language-injection">standard</a> language injection options used by tree-sitter, there
|
In addition to the <a href="https://tree-sitter.github.io/tree-sitter/3-syntax-highlighting.html#language-injection">standard</a> language injection options used by tree-sitter, there
|
||||||
are a few Helix specific extensions that allow for more control.</p>
|
are a few Helix specific extensions that allow for more control.</p>
|
||||||
<p>And example of a simple query that would highlight all strings as bash in Nix:</p>
|
<p>An example of a simple query that would highlight all strings as bash in Nix:</p>
|
||||||
<pre><code class="language-scm">((string_expression (string_fragment) @injection.content)
|
<pre><code class="language-scm">((string_expression (string_fragment) @injection.content)
|
||||||
(#set! injection.language "bash"))
|
(#set! injection.language "bash"))
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
<p>Another example is this query, which highlights links in comments and keywords like "TODO", by reusing the dedicated "comment" language:</p>
|
||||||
|
<pre><code>((comment) @injection.content
|
||||||
|
(#set! injection.language "comment"))
|
||||||
|
</code></pre>
|
||||||
<h2 id="capture-types"><a class="header" href="#capture-types">Capture Types</a></h2>
|
<h2 id="capture-types"><a class="header" href="#capture-types">Capture Types</a></h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|
|
@ -3435,10 +3435,14 @@ written explicitly for demonstration.)</p>
|
||||||
<p>Writing language injection queries allows one to highlight a specific node as a different language.
|
<p>Writing language injection queries allows one to highlight a specific node as a different language.
|
||||||
In addition to the <a href="https://tree-sitter.github.io/tree-sitter/3-syntax-highlighting.html#language-injection">standard</a> language injection options used by tree-sitter, there
|
In addition to the <a href="https://tree-sitter.github.io/tree-sitter/3-syntax-highlighting.html#language-injection">standard</a> language injection options used by tree-sitter, there
|
||||||
are a few Helix specific extensions that allow for more control.</p>
|
are a few Helix specific extensions that allow for more control.</p>
|
||||||
<p>And example of a simple query that would highlight all strings as bash in Nix:</p>
|
<p>An example of a simple query that would highlight all strings as bash in Nix:</p>
|
||||||
<pre><code class="language-scm">((string_expression (string_fragment) @injection.content)
|
<pre><code class="language-scm">((string_expression (string_fragment) @injection.content)
|
||||||
(#set! injection.language "bash"))
|
(#set! injection.language "bash"))
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
<p>Another example is this query, which highlights links in comments and keywords like "TODO", by reusing the dedicated "comment" language:</p>
|
||||||
|
<pre><code>((comment) @injection.content
|
||||||
|
(#set! injection.language "comment"))
|
||||||
|
</code></pre>
|
||||||
<h2 id="capture-types-1"><a class="header" href="#capture-types-1">Capture Types</a></h2>
|
<h2 id="capture-types-1"><a class="header" href="#capture-types-1">Capture Types</a></h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue