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:
Daniel S Poulin 2022-01-31 22:35:07 -05:00 committed by GitHub
parent 983a53bfb4
commit d6b6ad879e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 0 deletions

4
.gitmodules vendored
View File

@ -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

View File

@ -54,6 +54,7 @@
| toml | ✓ | | | |
| tsq | ✓ | | | |
| tsx | ✓ | | | `typescript-language-server` |
| twig | ✓ | | | |
| typescript | ✓ | | ✓ | `typescript-language-server` |
| vue | ✓ | | | |
| wgsl | ✓ | | | |

@ -0,0 +1 @@
Subproject commit b7444181fb38e603e25ea8fcdac55f9492e49c27

View File

@ -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"

View File

@ -0,0 +1,16 @@
(comment_directive) @comment
[
"{%"
"{%-"
"{%~"
"%}"
"-%}"
"~%}"
"{{"
"{{-"
"{{~"
"}}"
"-}}"
"~}}"
] @keyword

View File

@ -0,0 +1,3 @@
((content) @injection.content
(#set! injection.language "html")
(#set! injection.combined))