gh-pages
the-mikedavis 2025-04-09 12:30:23 +00:00
parent ceac60d3b7
commit e589fbb298
4 changed files with 12 additions and 4 deletions

View File

@ -164,10 +164,14 @@
<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
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)
(#set! injection.language "bash"))
</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>
<ul>
<li>

View File

@ -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.
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>
<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)
(#set! injection.language "bash"))
</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>
<ul>
<li>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long