From 8c35bd8e27adde64e6cd86afef32a341d5420f1c Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 10:29:54 +0000 Subject: [PATCH] languages: Apply JSX fixes to JavaScript highlights (#47130) (cherry-pick to preview) (#47131) Cherry-pick of #47130 to preview ---- 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 Co-authored-by: Finn Evers --- 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)