From 2321178f2857ca06ad866981bd8ed0bf4215b5b7 Mon Sep 17 00:00:00 2001 From: Finn Evers Date: Mon, 19 Jan 2026 10:50:48 +0100 Subject: [PATCH] languages: Apply JSX fixes to JavaScript highlights (#47130) Closes #46701 This ports the fixes from #46442 over to the JavaScript highlights, which we forgot to do in that PR since the highlights are not shareable and the fix was only applied to TSX... Hence, porting the fixes here manually to solve the issue for good. Release Notes: - Fixed an issue where JSX components were highlighted too broadly, causing normal HTML tags to be highlighted as such --- crates/languages/src/javascript/highlights.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/languages/src/javascript/highlights.scm b/crates/languages/src/javascript/highlights.scm index cb94f24ea22195b8d5b8b20c1740d5994d06a3e2..3194b256a944fcc0198a3cb948aa273431cc9f11 100644 --- a/crates/languages/src/javascript/highlights.scm +++ b/crates/languages/src/javascript/highlights.scm @@ -322,10 +322,6 @@ ] @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 @@ -354,6 +350,9 @@ ] ) +(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)