aboutsummaryrefslogtreecommitdiffstats
path: root/queries/jsx
diff options
context:
space:
mode:
authorRiley Bruins <ribru17@hotmail.com>2024-01-24 10:47:26 -0800
committerChristian Clason <c.clason@uni-graz.at>2024-01-25 09:11:48 +0100
commit314fe31dc787b99fe2f8738c71270ddec4f1a16f (patch)
tree33451d6ed6922b4045e7258fcb9725c5c7407c54 /queries/jsx
parentfix: format disassembly (diff)
downloadnvim-treesitter-314fe31dc787b99fe2f8738c71270ddec4f1a16f.tar
nvim-treesitter-314fe31dc787b99fe2f8738c71270ddec4f1a16f.tar.gz
nvim-treesitter-314fe31dc787b99fe2f8738c71270ddec4f1a16f.tar.bz2
nvim-treesitter-314fe31dc787b99fe2f8738c71270ddec4f1a16f.tar.lz
nvim-treesitter-314fe31dc787b99fe2f8738c71270ddec4f1a16f.tar.xz
nvim-treesitter-314fe31dc787b99fe2f8738c71270ddec4f1a16f.tar.zst
nvim-treesitter-314fe31dc787b99fe2f8738c71270ddec4f1a16f.zip
fix(jsx): proper tag and builtin tag distinction
Diffstat (limited to 'queries/jsx')
-rw-r--r--queries/jsx/highlights.scm30
1 files changed, 15 insertions, 15 deletions
diff --git a/queries/jsx/highlights.scm b/queries/jsx/highlights.scm
index 7f7177f83..5993ff7c4 100644
--- a/queries/jsx/highlights.scm
+++ b/queries/jsx/highlights.scm
@@ -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