JSX components with capital first letter highlighted as constructor rather than type

This commit is contained in:
napmn 2021-06-03 10:07:13 +02:00 committed by Kiyan
parent e98e2eafa2
commit 8e53e706e5

View file

@ -14,23 +14,23 @@
(jsx_self_closing_element
name: (identifier) @tag)
(jsx_opening_element ((identifier) @type
(#match? @type "^[A-Z]")))
(jsx_opening_element ((identifier) @constructor
(#match? @constructor "^[A-Z]")))
; Handle the dot operator effectively - <My.Component>
(jsx_opening_element ((nested_identifier (identifier) @tag (identifier) @type)))
(jsx_opening_element ((nested_identifier (identifier) @tag (identifier) @constructor)))
(jsx_closing_element ((identifier) @type
(#match? @type "^[A-Z]")))
(jsx_closing_element ((identifier) @constructor
(#match? @constructor "^[A-Z]")))
; Handle the dot operator effectively - </My.Component>
(jsx_closing_element ((nested_identifier (identifier) @tag (identifier) @type)))
(jsx_closing_element ((nested_identifier (identifier) @tag (identifier) @constructor)))
(jsx_self_closing_element ((identifier) @type
(#match? @type "^[A-Z]")))
(jsx_self_closing_element ((identifier) @constructor
(#match? @constructor "^[A-Z]")))
; Handle the dot operator effectively - <My.Component />
(jsx_self_closing_element ((nested_identifier (identifier) @tag (identifier) @type)))
(jsx_self_closing_element ((nested_identifier (identifier) @tag (identifier) @constructor)))
(variable_declarator ((identifier) @type
(#match? @type "^[A-Z]")))