mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-07 14:00:00 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
c13e28f894
commit
2c8f2f2fad
829 changed files with 4905 additions and 8010 deletions
6
runtime/queries/vue/folds.scm
Normal file
6
runtime/queries/vue/folds.scm
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
(element)
|
||||
(template_element)
|
||||
(script_element)
|
||||
(style_element)
|
||||
] @fold
|
||||
23
runtime/queries/vue/highlights.scm
Normal file
23
runtime/queries/vue/highlights.scm
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
; inherits: html_tags
|
||||
|
||||
[
|
||||
(directive_dynamic_argument)
|
||||
(directive_dynamic_argument_value)
|
||||
] @tag
|
||||
|
||||
(interpolation) @punctuation.special
|
||||
(interpolation
|
||||
(raw_text) @none)
|
||||
|
||||
(directive_name) @tag.attribute
|
||||
|
||||
(directive_attribute
|
||||
(quoted_attribute_value) @punctuation.special)
|
||||
|
||||
(directive_attribute
|
||||
(quoted_attribute_value (attribute_value) @none))
|
||||
|
||||
[
|
||||
(directive_modifier)
|
||||
(directive_argument)
|
||||
] @method
|
||||
7
runtime/queries/vue/indents.scm
Normal file
7
runtime/queries/vue/indents.scm
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
; inherits: html_tags
|
||||
|
||||
[
|
||||
(template_element)
|
||||
] @indent.begin
|
||||
|
||||
(template_element (end_tag ">" @indent.end) @indent.branch)
|
||||
80
runtime/queries/vue/injections.scm
Normal file
80
runtime/queries/vue/injections.scm
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
; inherits html_tags
|
||||
|
||||
; <script lang="css">
|
||||
((style_element
|
||||
(start_tag
|
||||
(attribute
|
||||
(attribute_name) @_lang
|
||||
(quoted_attribute_value (attribute_value) @injection.language)))
|
||||
(raw_text) @injection.content)
|
||||
(#eq? @_lang "lang")
|
||||
(#any-of? @injection.language "css" "scss")
|
||||
(#set! injection.include-children))
|
||||
|
||||
; TODO: When nvim-treesitter has postcss and less parsers, use @injection.language and @injection.content instead
|
||||
; <script lang="scss">
|
||||
((style_element
|
||||
(start_tag
|
||||
(attribute
|
||||
(attribute_name) @_lang
|
||||
(quoted_attribute_value (attribute_value) @_scss)))
|
||||
(raw_text) @injection.content
|
||||
(#eq? @_lang "lang")
|
||||
(#any-of? @_scss "less" "postcss")
|
||||
(#set! injection.language "scss")
|
||||
(#set! injection.include-children)))
|
||||
|
||||
; <script lang="js">
|
||||
((script_element
|
||||
(start_tag
|
||||
(attribute
|
||||
(attribute_name) @_lang
|
||||
(quoted_attribute_value (attribute_value) @_js)))
|
||||
(raw_text) @injection.content)
|
||||
(#eq? @_lang "lang")
|
||||
(#eq? @_js "js")
|
||||
(#set! injection.language "javascript")
|
||||
(#set! injection.include-children))
|
||||
|
||||
; <script lang="ts">
|
||||
((script_element
|
||||
(start_tag
|
||||
(attribute
|
||||
(attribute_name) @_lang
|
||||
(quoted_attribute_value (attribute_value) @_ts)))
|
||||
(raw_text) @injection.content)
|
||||
(#eq? @_lang "lang")
|
||||
(#eq? @_ts "ts")
|
||||
(#set! injection.language "typescript")
|
||||
(#set! injection.include-children))
|
||||
|
||||
; <script lang="tsx">
|
||||
; <script lang="jsx">
|
||||
((script_element
|
||||
(start_tag
|
||||
(attribute
|
||||
(attribute_name) @_attr
|
||||
(quoted_attribute_value (attribute_value) @injection.language)))
|
||||
(#eq? @_attr "lang")
|
||||
(#any-of? @injection.language "tsx" "jsx")
|
||||
(raw_text) @injection.content)
|
||||
(#set! injection.include-children))
|
||||
|
||||
((interpolation
|
||||
(raw_text) @injection.content)
|
||||
(#set! injection.language "javascript")
|
||||
(#set! injection.include-children))
|
||||
|
||||
(directive_attribute
|
||||
(quoted_attribute_value
|
||||
(attribute_value) @injection.content
|
||||
(#set! injection.language "javascript")
|
||||
(#set! injection.include-children)))
|
||||
|
||||
(template_element
|
||||
(start_tag
|
||||
(attribute
|
||||
(quoted_attribute_value (attribute_value) @injection.language)))
|
||||
(text) @injection.content
|
||||
(#eq? @injection.language "pug")
|
||||
(#set! injection.include-children))
|
||||
Loading…
Add table
Add a link
Reference in a new issue