mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -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)
|
||||
|
||||
(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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue