Skip to content

Commit e2757dd

Browse files
author
Lucas Renaudineau
committed
Merge branch 'master' into themes_separation
2 parents a8005d5 + 8b952bb commit e2757dd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

book/src/guides/injection.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ Writing language injection queries allows one to highlight a specific node as a
44
In addition to the [standard][upstream-docs] language injection options used by tree-sitter, there
55
are a few Helix specific extensions that allow for more control.
66

7-
And example of a simple query that would highlight all strings as bash in Nix:
7+
An example of a simple query that would highlight all strings as bash in Nix:
88
```scm
99
((string_expression (string_fragment) @injection.content)
1010
(#set! injection.language "bash"))
1111
```
12+
Another example is this query, which highlights links in comments and keywords like "TODO", by reusing the dedicated "comment" language:
13+
```
14+
((comment) @injection.content
15+
(#set! injection.language "comment"))
16+
```
1217

1318
## Capture Types
1419

0 commit comments

Comments
 (0)