mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
JSX components with capital first letter highlighted as constructor rather than type
This commit is contained in:
parent
e98e2eafa2
commit
8e53e706e5
1 changed files with 9 additions and 9 deletions
|
|
@ -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]")))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue