mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-10 15:30:01 -04:00
fix(jsx): proper tag and builtin tag distinction
This commit is contained in:
parent
1d83fc08d4
commit
314fe31dc7
1 changed files with 15 additions and 15 deletions
|
|
@ -24,42 +24,42 @@
|
||||||
(property_identifier) @tag.attribute)
|
(property_identifier) @tag.attribute)
|
||||||
|
|
||||||
(jsx_opening_element
|
(jsx_opening_element
|
||||||
name: (identifier) @tag)
|
name: (identifier) @tag.builtin)
|
||||||
|
|
||||||
(jsx_closing_element
|
(jsx_closing_element
|
||||||
name: (identifier) @tag)
|
name: (identifier) @tag.builtin)
|
||||||
|
|
||||||
(jsx_self_closing_element
|
(jsx_self_closing_element
|
||||||
name: (identifier) @tag)
|
name: (identifier) @tag.builtin)
|
||||||
|
|
||||||
(jsx_opening_element
|
(jsx_opening_element
|
||||||
((identifier) @constructor
|
((identifier) @tag
|
||||||
(#lua-match? @constructor "^[A-Z]")))
|
(#lua-match? @tag "^[A-Z]")))
|
||||||
|
|
||||||
; Handle the dot operator effectively - <My.Component>
|
; Handle the dot operator effectively - <My.Component>
|
||||||
(jsx_opening_element
|
(jsx_opening_element
|
||||||
(member_expression
|
(member_expression
|
||||||
(identifier) @tag
|
(identifier) @tag.builtin
|
||||||
(property_identifier) @constructor))
|
(property_identifier) @tag))
|
||||||
|
|
||||||
(jsx_closing_element
|
(jsx_closing_element
|
||||||
((identifier) @constructor
|
((identifier) @tag
|
||||||
(#lua-match? @constructor "^[A-Z]")))
|
(#lua-match? @tag "^[A-Z]")))
|
||||||
|
|
||||||
; Handle the dot operator effectively - </My.Component>
|
; Handle the dot operator effectively - </My.Component>
|
||||||
(jsx_closing_element
|
(jsx_closing_element
|
||||||
(member_expression
|
(member_expression
|
||||||
(identifier) @tag
|
(identifier) @tag.builtin
|
||||||
(property_identifier) @constructor))
|
(property_identifier) @tag))
|
||||||
|
|
||||||
(jsx_self_closing_element
|
(jsx_self_closing_element
|
||||||
((identifier) @constructor
|
((identifier) @tag
|
||||||
(#lua-match? @constructor "^[A-Z]")))
|
(#lua-match? @tag "^[A-Z]")))
|
||||||
|
|
||||||
; Handle the dot operator effectively - <My.Component />
|
; Handle the dot operator effectively - <My.Component />
|
||||||
(jsx_self_closing_element
|
(jsx_self_closing_element
|
||||||
(member_expression
|
(member_expression
|
||||||
(identifier) @tag
|
(identifier) @tag.builtin
|
||||||
(property_identifier) @constructor))
|
(property_identifier) @tag))
|
||||||
|
|
||||||
(jsx_text) @none
|
(jsx_text) @none
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue