on master help sign in
epocsquadron/add tree sitter twig (#1602)
d6b6ad8Daniel S Poulin
.gitmodules+4
@@ -218,3 +218,7 @@
218 path = helix-syntax/languages/tree-sitter-iex
218 path = helix-syntax/languages/tree-sitter-iex
219 url = https://github.com/elixir-lang/tree-sitter-iex
219 url = https://github.com/elixir-lang/tree-sitter-iex
220 shallow = true
220 shallow = true
221+[submodule "helix-syntax/languages/tree-sitter-twig"]
222+ path = helix-syntax/languages/tree-sitter-twig
223+ url = https://github.com/eirabben/tree-sitter-twig.git
224+ shallow = true
book/src/generated/lang-support.md+1
@@ -54,6 +54,7 @@
54| toml | ✓ | | | |
54| toml | ✓ | | | |
55| tsq | ✓ | | | |
55| tsq | ✓ | | | |
56| tsx | ✓ | | | `typescript-language-server` |
56| tsx | ✓ | | | `typescript-language-server` |
57+| twig | ✓ | | | |
57| typescript | ✓ | | ✓ | `typescript-language-server` |
58| typescript | ✓ | | ✓ | `typescript-language-server` |
58| vue | ✓ | | | |
59| vue | ✓ | | | |
59| wgsl | ✓ | | | |
60| wgsl | ✓ | | | |
helix-syntax/languages/tree-sitter-twignew file+1

Submodule changed.

languages.toml+9
@@ -231,6 +231,15 @@ roots = []
231
231
232indent = { tab-width = 4, unit = " " }
232indent = { tab-width = 4, unit = " " }
233
233
234+[[language]]
235+name = "twig"
236+scope = "source.twig"
237+injection-regex = "twig"
238+file-types = ["twig"]
239+roots = []
240+
241+indent = { tab-width = 2, unit = " " }
242+
234[[language]]
243[[language]]
235name = "latex"
244name = "latex"
236scope = "source.tex"
245scope = "source.tex"
runtime/queries/twig/highlights.scmnew file+16
@@ -0,0 +1,16 @@
1+(comment_directive) @comment
2+
3+[
4+ "{%"
5+ "{%-"
6+ "{%~"
7+ "%}"
8+ "-%}"
9+ "~%}"
10+ "{{"
11+ "{{-"
12+ "{{~"
13+ "}}"
14+ "-}}"
15+ "~}}"
16+] @keyword
runtime/queries/twig/injections.scmnew file+3
@@ -0,0 +1,3 @@
1+((content) @injection.content
2+ (#set! injection.language "html")
3+ (#set! injection.combined))