mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
add @tag.attribute for html like attributes
This commit is contained in:
parent
29113e6892
commit
fb5d6e04a8
5 changed files with 8 additions and 1 deletions
|
|
@ -185,6 +185,7 @@ Used for xml-like tags
|
||||||
|
|
||||||
```
|
```
|
||||||
@tag
|
@tag
|
||||||
|
@tag.attribute
|
||||||
@tag.delimiter
|
@tag.delimiter
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -616,6 +616,10 @@ For identifiers referring to symbols or atoms.
|
||||||
`TSTag`
|
`TSTag`
|
||||||
Tags like html tag names.
|
Tags like html tag names.
|
||||||
|
|
||||||
|
*hl-TSTagAttribute*
|
||||||
|
`TSTagAttribute`
|
||||||
|
For html tag attributes.
|
||||||
|
|
||||||
*hl-TSTagDelimiter*
|
*hl-TSTagDelimiter*
|
||||||
`TSTagDelimiter`
|
`TSTagDelimiter`
|
||||||
Tag delimiter like `<` `>` `/`
|
Tag delimiter like `<` `>` `/`
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ hlmap["string.special"] = "TSStringSpecial"
|
||||||
hlmap["symbol"] = "TSSymbol"
|
hlmap["symbol"] = "TSSymbol"
|
||||||
|
|
||||||
hlmap["tag"] = "TSTag"
|
hlmap["tag"] = "TSTag"
|
||||||
|
hlmap["tag.attribute"] = "TSTagAttribute"
|
||||||
hlmap["tag.delimiter"] = "TSTagDelimiter"
|
hlmap["tag.delimiter"] = "TSTagDelimiter"
|
||||||
|
|
||||||
hlmap["text"] = "TSText"
|
hlmap["text"] = "TSText"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
(tag_name) @tag
|
(tag_name) @tag
|
||||||
(erroneous_end_tag_name) @error
|
(erroneous_end_tag_name) @error
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
(attribute_name) @property
|
(attribute_name) @tag.attribute
|
||||||
(attribute_value) @string
|
(attribute_value) @string
|
||||||
(quoted_attribute_value) @string
|
(quoted_attribute_value) @string
|
||||||
(text) @none
|
(text) @none
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
close_tag: (jsx_closing_element ["<" "/" ">"] @tag.delimiter))
|
close_tag: (jsx_closing_element ["<" "/" ">"] @tag.delimiter))
|
||||||
(jsx_self_closing_element ["/" ">" "<"] @tag.delimiter)
|
(jsx_self_closing_element ["/" ">" "<"] @tag.delimiter)
|
||||||
(jsx_fragment [">" "<" "/"] @tag.delimiter)
|
(jsx_fragment [">" "<" "/"] @tag.delimiter)
|
||||||
|
(jsx_attribute (property_identifier) @tag.attribute)
|
||||||
|
|
||||||
(jsx_opening_element
|
(jsx_opening_element
|
||||||
name: (identifier) @tag)
|
name: (identifier) @tag)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue