on master help sign in
Add Vue tree sitter grammar (#787)
a7f49faThomas Wehmöller
.gitmodules+4
@@ -122,3 +122,7 @@
122 path = helix-syntax/languages/tree-sitter-svelte
122 path = helix-syntax/languages/tree-sitter-svelte
123 url = https://github.com/Himujjal/tree-sitter-svelte
123 url = https://github.com/Himujjal/tree-sitter-svelte
124 shallow = true
124 shallow = true
125+[submodule "helix-syntax/languages/tree-sitter-vue"]
126+ path = helix-syntax/languages/tree-sitter-vue
127+ url = https://github.com/ikatyang/tree-sitter-vue
128+ shallow = true
helix-syntax/languages/tree-sitter-vuenew file+1

Submodule changed.

languages.toml+9
@@ -278,6 +278,15 @@ roots = []
278indent = { tab-width = 2, unit = " " }
278indent = { tab-width = 2, unit = " " }
279language-server = { command = "svelteserver", args = ["--stdio"] }
279language-server = { command = "svelteserver", args = ["--stdio"] }
280
280
281+
282+[[language]]
283+name = "vue"
284+scope = "source.vue"
285+injection-regex = "vue"
286+file-types = ["vue"]
287+roots = []
288+indent = { tab-width = 2, unit = " " }
289+
281[[language]]
290[[language]]
282name = "yaml"
291name = "yaml"
283scope = "source.yaml"
292scope = "source.yaml"
runtime/queries/vue/highlights.scmnew file+21
@@ -0,0 +1,21 @@
1+(tag_name) @tag
2+(end_tag) @tag
3+
4+(directive_name) @keyword
5+(directive_argument) @constant
6+
7+(attribute
8+ (attribute_name) @attribute
9+ (quoted_attribute_value
10+ (attribute_value) @string)
11+)
12+
13+(comment) @comment
14+
15+[
16+ "<"
17+ ">"
18+ "</"
19+ "{{"
20+ "}}"
21+] @punctuation.bracket
runtime/queries/vue/injections.scmnew file+17
@@ -0,0 +1,17 @@
1+(directive_attribute
2+ (directive_name) @keyword
3+ (quoted_attribute_value
4+ (attribute_value) @injection.content)
5+ (#set! injection.language "javascript"))
6+
7+((interpolation
8+ (raw_text) @injection.content)
9+ (#set! injection.language "javascript"))
10+
11+((script_element
12+ (raw_text) @injection.content)
13+ (#set! injection.language "javascript"))
14+
15+((style_element
16+ (raw_text) @injection.content)
17+ (#set! injection.language "css"))