Add Vue tree sitter grammar (#787)

*  Add vue tree sitter support

* Update .gitmodules

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
This commit is contained in:
Thomas Wehmöller 2021-10-10 15:09:17 +02:00 committed by GitHub
parent 4260b31ec0
commit a7f49fa56f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 52 additions and 0 deletions

4
.gitmodules vendored
View file

@ -122,3 +122,7 @@
path = helix-syntax/languages/tree-sitter-svelte
url = https://github.com/Himujjal/tree-sitter-svelte
shallow = true
[submodule "helix-syntax/languages/tree-sitter-vue"]
path = helix-syntax/languages/tree-sitter-vue
url = https://github.com/ikatyang/tree-sitter-vue
shallow = true

@ -0,0 +1 @@
Subproject commit 91fe2754796cd8fba5f229505a23fa08f3546c06

View file

@ -278,6 +278,15 @@ roots = []
indent = { tab-width = 2, unit = " " }
language-server = { command = "svelteserver", args = ["--stdio"] }
[[language]]
name = "vue"
scope = "source.vue"
injection-regex = "vue"
file-types = ["vue"]
roots = []
indent = { tab-width = 2, unit = " " }
[[language]]
name = "yaml"
scope = "source.yaml"

View file

@ -0,0 +1,21 @@
(tag_name) @tag
(end_tag) @tag
(directive_name) @keyword
(directive_argument) @constant
(attribute
(attribute_name) @attribute
(quoted_attribute_value
(attribute_value) @string)
)
(comment) @comment
[
"<"
">"
"</"
"{{"
"}}"
] @punctuation.bracket

View file

@ -0,0 +1,17 @@
(directive_attribute
(directive_name) @keyword
(quoted_attribute_value
(attribute_value) @injection.content)
(#set! injection.language "javascript"))
((interpolation
(raw_text) @injection.content)
(#set! injection.language "javascript"))
((script_element
(raw_text) @injection.content)
(#set! injection.language "javascript"))
((style_element
(raw_text) @injection.content)
(#set! injection.language "css"))