mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 03:56:52 -04:00
Add support for Vue files
I haven't included parsing the `style` tag, since the only applicable queries we have are CSS (which actually works fine for SCSS too).
This commit is contained in:
parent
6f25f2d8af
commit
ff7ec08a1e
2 changed files with 57 additions and 0 deletions
38
queries/vue/highlights.scm
Normal file
38
queries/vue/highlights.scm
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
[
|
||||
(component)
|
||||
(template_element)
|
||||
(start_tag)
|
||||
(tag_name)
|
||||
(directive_attribute)
|
||||
(directive_dynamic_argument)
|
||||
(directive_dynamic_argument_value)
|
||||
(component)
|
||||
(end_tag)
|
||||
] @tag
|
||||
|
||||
(erroneous_end_tag_name) @error
|
||||
(attribute_name) @property
|
||||
(attribute_value) @string
|
||||
(quoted_attribute_value) @string
|
||||
(comment) @comment
|
||||
|
||||
(text) @none
|
||||
(element) @string
|
||||
(interpolation) @punctuation.special
|
||||
(interpolation
|
||||
(raw_text) @none)
|
||||
|
||||
[
|
||||
(directive_modifier)
|
||||
(directive_name)
|
||||
(directive_argument)
|
||||
] @method
|
||||
|
||||
"=" @operator
|
||||
|
||||
[
|
||||
"<"
|
||||
">"
|
||||
"</"
|
||||
"/>"
|
||||
] @tag.delimiter
|
||||
19
queries/vue/injections.scm
Normal file
19
queries/vue/injections.scm
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
((style_element
|
||||
(raw_text) @css))
|
||||
|
||||
; There's no queries for less, sass nor postcss.
|
||||
|
||||
((script_element
|
||||
(raw_text) @javascript))
|
||||
|
||||
(
|
||||
(script_element
|
||||
(start_tag
|
||||
(attribute
|
||||
(quoted_attribute_value (attribute_value) @_lang)))
|
||||
(raw_text) @typescript)
|
||||
(#match? @_lang "(ts|typescript)")
|
||||
)
|
||||
|
||||
((interpolation
|
||||
(raw_text) @javascript))
|
||||
Loading…
Add table
Add a link
Reference in a new issue