mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 10:20:11 -04:00
feat: add support for svelte
This commit is contained in:
parent
2d82a7fe07
commit
a73e200abf
5 changed files with 79 additions and 0 deletions
9
queries/svelte/folds.scm
Normal file
9
queries/svelte/folds.scm
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[
|
||||
(style_element)
|
||||
(script_element)
|
||||
(element)
|
||||
(if_statement)
|
||||
(else_statement)
|
||||
(each_statement)
|
||||
(await_statement)
|
||||
] @fold
|
||||
29
queries/svelte/highlights.scm
Normal file
29
queries/svelte/highlights.scm
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
(tag_name) @tag
|
||||
(attribute_name) @property
|
||||
(attribute_value) @string
|
||||
(quoted_attribute_value) @string
|
||||
(comment) @comment
|
||||
|
||||
[
|
||||
(special_block_keyword)
|
||||
(then)
|
||||
(as)
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
"=" @operator
|
||||
|
||||
[
|
||||
"<"
|
||||
">"
|
||||
"</"
|
||||
"/>"
|
||||
"#"
|
||||
":"
|
||||
"/"
|
||||
"@"
|
||||
] @tag.delimiter
|
||||
16
queries/svelte/indents.scm
Normal file
16
queries/svelte/indents.scm
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
[
|
||||
(element)
|
||||
(if_statement)
|
||||
(each_statement)
|
||||
(await_statement)
|
||||
] @indent
|
||||
|
||||
[
|
||||
(end_tag)
|
||||
(else_statement)
|
||||
(if_end_expr)
|
||||
(each_end_expr)
|
||||
(await_end_expr)
|
||||
">"
|
||||
"/>"
|
||||
] @branch
|
||||
16
queries/svelte/injections.scm
Normal file
16
queries/svelte/injections.scm
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
((style_element
|
||||
(raw_text) @css))
|
||||
|
||||
((script_element
|
||||
(raw_text) @javascript))
|
||||
|
||||
((raw_text_expr) @javascript)
|
||||
|
||||
(
|
||||
(script_element
|
||||
(start_tag
|
||||
(attribute
|
||||
(quoted_attribute_value (attribute_value) @_lang)))
|
||||
(raw_text) @typescript)
|
||||
(#match? @_lang "(ts|typescript)")
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue