mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-12-01 11:23:10 +03:00
epocsquadron/add tree sitter twig (#1602)
* Add tree-sitter-twig grammer and highlights The gammar itself is quite basic, but is much better than nothing for working with real files consisting mostly of html. * Docgen for newly added grammar
This commit is contained in:
parent
983a53bfb4
commit
d6b6ad879e
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -218,3 +218,7 @@
|
||||
path = helix-syntax/languages/tree-sitter-iex
|
||||
url = https://github.com/elixir-lang/tree-sitter-iex
|
||||
shallow = true
|
||||
[submodule "helix-syntax/languages/tree-sitter-twig"]
|
||||
path = helix-syntax/languages/tree-sitter-twig
|
||||
url = https://github.com/eirabben/tree-sitter-twig.git
|
||||
shallow = true
|
||||
|
@ -54,6 +54,7 @@
|
||||
| toml | ✓ | | | |
|
||||
| tsq | ✓ | | | |
|
||||
| tsx | ✓ | | | `typescript-language-server` |
|
||||
| twig | ✓ | | | |
|
||||
| typescript | ✓ | | ✓ | `typescript-language-server` |
|
||||
| vue | ✓ | | | |
|
||||
| wgsl | ✓ | | | |
|
||||
|
1
helix-syntax/languages/tree-sitter-twig
Submodule
1
helix-syntax/languages/tree-sitter-twig
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit b7444181fb38e603e25ea8fcdac55f9492e49c27
|
@ -231,6 +231,15 @@ roots = []
|
||||
|
||||
indent = { tab-width = 4, unit = " " }
|
||||
|
||||
[[language]]
|
||||
name = "twig"
|
||||
scope = "source.twig"
|
||||
injection-regex = "twig"
|
||||
file-types = ["twig"]
|
||||
roots = []
|
||||
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
|
||||
[[language]]
|
||||
name = "latex"
|
||||
scope = "source.tex"
|
||||
|
16
runtime/queries/twig/highlights.scm
Normal file
16
runtime/queries/twig/highlights.scm
Normal file
@ -0,0 +1,16 @@
|
||||
(comment_directive) @comment
|
||||
|
||||
[
|
||||
"{%"
|
||||
"{%-"
|
||||
"{%~"
|
||||
"%}"
|
||||
"-%}"
|
||||
"~%}"
|
||||
"{{"
|
||||
"{{-"
|
||||
"{{~"
|
||||
"}}"
|
||||
"-}}"
|
||||
"~}}"
|
||||
] @keyword
|
3
runtime/queries/twig/injections.scm
Normal file
3
runtime/queries/twig/injections.scm
Normal file
@ -0,0 +1,3 @@
|
||||
((content) @injection.content
|
||||
(#set! injection.language "html")
|
||||
(#set! injection.combined))
|
Loading…
Reference in New Issue
Block a user