mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 09:50:04 -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
|
(jsx_self_closing_element
|
||||||
name: (identifier) @tag)
|
name: (identifier) @tag)
|
||||||
|
|
||||||
(jsx_opening_element ((identifier) @type
|
(jsx_opening_element ((identifier) @constructor
|
||||||
(#match? @type "^[A-Z]")))
|
(#match? @constructor "^[A-Z]")))
|
||||||
|
|
||||||
; Handle the dot operator effectively - <My.Component>
|
; 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
|
(jsx_closing_element ((identifier) @constructor
|
||||||
(#match? @type "^[A-Z]")))
|
(#match? @constructor "^[A-Z]")))
|
||||||
|
|
||||||
; Handle the dot operator effectively - </My.Component>
|
; 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
|
(jsx_self_closing_element ((identifier) @constructor
|
||||||
(#match? @type "^[A-Z]")))
|
(#match? @constructor "^[A-Z]")))
|
||||||
|
|
||||||
; Handle the dot operator effectively - <My.Component />
|
; 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
|
(variable_declarator ((identifier) @type
|
||||||
(#match? @type "^[A-Z]")))
|
(#match? @type "^[A-Z]")))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue