mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
chore: query formatting
This commit is contained in:
parent
79975d6557
commit
57a8acf0c4
674 changed files with 18466 additions and 12648 deletions
|
|
@ -1,11 +1,11 @@
|
|||
; inherits: html_tags
|
||||
|
||||
[
|
||||
(directive_dynamic_argument)
|
||||
(directive_dynamic_argument_value)
|
||||
] @tag
|
||||
|
||||
(interpolation) @punctuation.special
|
||||
|
||||
(interpolation
|
||||
(raw_text) @none)
|
||||
|
||||
|
|
@ -15,7 +15,8 @@
|
|||
(quoted_attribute_value) @punctuation.special)
|
||||
|
||||
(directive_attribute
|
||||
(quoted_attribute_value (attribute_value) @none))
|
||||
(quoted_attribute_value
|
||||
(attribute_value) @none))
|
||||
|
||||
[
|
||||
(directive_modifier)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
; inherits: html_tags
|
||||
(template_element) @indent.begin
|
||||
|
||||
[
|
||||
(template_element)
|
||||
] @indent.begin
|
||||
|
||||
(template_element (end_tag ">" @indent.end) @indent.branch)
|
||||
(template_element
|
||||
(end_tag
|
||||
">" @indent.end) @indent.branch)
|
||||
|
|
|
|||
|
|
@ -1,59 +1,63 @@
|
|||
; 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"))
|
||||
(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"))
|
||||
|
||||
; 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")))
|
||||
(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")))
|
||||
|
||||
; <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"))
|
||||
(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"))
|
||||
|
||||
; <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"))
|
||||
(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"))
|
||||
|
||||
; <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))
|
||||
(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))
|
||||
|
||||
((interpolation
|
||||
(raw_text) @injection.content)
|
||||
|
|
@ -65,8 +69,9 @@
|
|||
(#set! injection.language "typescript")))
|
||||
|
||||
(template_element
|
||||
(start_tag
|
||||
(attribute
|
||||
(quoted_attribute_value (attribute_value) @injection.language)))
|
||||
(text) @injection.content
|
||||
(#eq? @injection.language "pug"))
|
||||
(start_tag
|
||||
(attribute
|
||||
(quoted_attribute_value
|
||||
(attribute_value) @injection.language)))
|
||||
(text) @injection.content
|
||||
(#eq? @injection.language "pug"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue