From 206f54e3d7b0e8d09745a870fa9bf6df9f7abcec Mon Sep 17 00:00:00 2001 From: Finn Evers Date: Fri, 9 Jan 2026 13:59:54 +0100 Subject: [PATCH] languages: Do not highlight JSX/TSX components too broadly (#46442) Closes #46340 Release Notes: - Fixed an issue where HTML tags where highlighted as JSX components. --- crates/languages/src/tsx/highlights.scm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/languages/src/tsx/highlights.scm b/crates/languages/src/tsx/highlights.scm index 9a265b0f7999ce624c27f9c9d07e20b79e43fba1..a9cac693cead73cb04d7f1f8e15fa64df81d1da6 100644 --- a/crates/languages/src/tsx/highlights.scm +++ b/crates/languages/src/tsx/highlights.scm @@ -381,11 +381,6 @@ "override" ] @keyword -; JSX elements -(jsx_opening_element (identifier) @tag.jsx (#match? @tag.jsx "^[a-z][^.]*$")) -(jsx_closing_element (identifier) @tag.jsx (#match? @tag.jsx "^[a-z][^.]*$")) -(jsx_self_closing_element (identifier) @tag.jsx (#match? @tag.jsx "^[a-z][^.]*$")) - (jsx_opening_element [ (identifier) @type @@ -414,6 +409,10 @@ ] ) +(jsx_opening_element (identifier) @tag.jsx (#match? @tag.jsx "^[a-z][^.]*$")) +(jsx_closing_element (identifier) @tag.jsx (#match? @tag.jsx "^[a-z][^.]*$")) +(jsx_self_closing_element (identifier) @tag.jsx (#match? @tag.jsx "^[a-z][^.]*$")) + (jsx_attribute (property_identifier) @attribute.jsx) (jsx_opening_element (["<" ">"]) @punctuation.bracket.jsx) (jsx_closing_element ([""]) @punctuation.bracket.jsx)