mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
feat(wxml): add parser and queries
This commit is contained in:
parent
16da7ded58
commit
cd64fd3f44
6 changed files with 124 additions and 0 deletions
66
runtime/queries/wxml/highlights.scm
Normal file
66
runtime/queries/wxml/highlights.scm
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
; Comments
|
||||
(comment) @comment @spell
|
||||
|
||||
; Text
|
||||
(text) @spell
|
||||
|
||||
; Tag names
|
||||
(tag_name) @tag
|
||||
|
||||
((tag_name) @tag.builtin
|
||||
(#any-of? @tag.builtin "wxs" "template" "import" "include" "slot" "block"))
|
||||
|
||||
; Attributes
|
||||
(attribute_name) @tag.attribute
|
||||
|
||||
(attribute_value) @string
|
||||
|
||||
(quoted_attribute_value) @string
|
||||
|
||||
; WeChat specific attributes
|
||||
((attribute_name) @keyword.directive
|
||||
(#lua-match? @keyword.directive "^wx:"))
|
||||
|
||||
((attribute_name) @keyword.conditional
|
||||
(#any-of? @keyword.conditional "wx:if" "wx:elif" "wx:else"))
|
||||
|
||||
((attribute_name) @keyword.repeat
|
||||
(#any-of? @keyword.repeat "wx:for" "wx:for-index" "wx:for-item"))
|
||||
|
||||
((attribute_name) @keyword
|
||||
(#lua-match? @keyword "^bind"))
|
||||
|
||||
((attribute_name) @keyword
|
||||
(#lua-match? @keyword "^catch"))
|
||||
|
||||
((attribute_name) @keyword
|
||||
(#lua-match? @keyword "^mut%-bind"))
|
||||
|
||||
((attribute_name) @keyword
|
||||
(#lua-match? @keyword "^model:"))
|
||||
|
||||
((attribute_name) @keyword
|
||||
(#lua-match? @keyword "^data-"))
|
||||
|
||||
((attribute
|
||||
(attribute_name) @_attr
|
||||
(quoted_attribute_value) @string.special.url)
|
||||
(#any-of? @_attr "href" "src")
|
||||
(#offset! @string.special.url 0 1 0 -1))
|
||||
|
||||
; Entity references
|
||||
(entity) @character.special
|
||||
|
||||
; Interpolation delimiters
|
||||
(interpolation_start) @punctuation.special
|
||||
|
||||
(interpolation_end) @punctuation.special
|
||||
|
||||
[
|
||||
"<"
|
||||
">"
|
||||
"</"
|
||||
"/>"
|
||||
] @tag.delimiter
|
||||
|
||||
"=" @operator
|
||||
Loading…
Add table
Add a link
Reference in a new issue