fix(jsx): proper tag and builtin tag distinction

This commit is contained in:
Riley Bruins 2024-01-24 10:47:26 -08:00 committed by Christian Clason
parent 1d83fc08d4
commit 314fe31dc7

View file

@ -24,42 +24,42 @@
(property_identifier) @tag.attribute)
(jsx_opening_element
name: (identifier) @tag)
name: (identifier) @tag.builtin)
(jsx_closing_element
name: (identifier) @tag)
name: (identifier) @tag.builtin)
(jsx_self_closing_element
name: (identifier) @tag)
name: (identifier) @tag.builtin)
(jsx_opening_element
((identifier) @constructor
(#lua-match? @constructor "^[A-Z]")))
((identifier) @tag
(#lua-match? @tag "^[A-Z]")))
; Handle the dot operator effectively - <My.Component>
(jsx_opening_element
(member_expression
(identifier) @tag
(property_identifier) @constructor))
(identifier) @tag.builtin
(property_identifier) @tag))
(jsx_closing_element
((identifier) @constructor
(#lua-match? @constructor "^[A-Z]")))
((identifier) @tag
(#lua-match? @tag "^[A-Z]")))
; Handle the dot operator effectively - </My.Component>
(jsx_closing_element
(member_expression
(identifier) @tag
(property_identifier) @constructor))
(identifier) @tag.builtin
(property_identifier) @tag))
(jsx_self_closing_element
((identifier) @constructor
(#lua-match? @constructor "^[A-Z]")))
((identifier) @tag
(#lua-match? @tag "^[A-Z]")))
; Handle the dot operator effectively - <My.Component />
(jsx_self_closing_element
(member_expression
(identifier) @tag
(property_identifier) @constructor))
(identifier) @tag.builtin
(property_identifier) @tag))
(jsx_text) @none