From 1c39e192f1fa83a6d131d4f43d13ade53e8a424d Mon Sep 17 00:00:00 2001 From: Kunall Banerjee Date: Thu, 26 Feb 2026 22:14:40 -0500 Subject: [PATCH] languages: Reorder type identifier highlights in JavaScript (#49325) Move general type identifier rules before class-specific ones to ensure proper precedence in the syntax highlighting query. Closes #49226. Before you mark this PR as ready for review, make sure that you have: - [ ] Added a solid test coverage and/or screenshots from doing manual testing - [x] Done a self-review taking into account security and performance aspects - [x] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - Fixed an issue where class names were not highlighted correctly in JavaScript files --- crates/languages/src/javascript/highlights.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/languages/src/javascript/highlights.scm b/crates/languages/src/javascript/highlights.scm index 5561dc31d56d52e6b4d6f71c07137537953410f6..5fb31ce100b5884d99d3e941ce6fb67b69ff2cfd 100644 --- a/crates/languages/src/javascript/highlights.scm +++ b/crates/languages/src/javascript/highlights.scm @@ -120,15 +120,15 @@ ; Special identifiers ; +(type_identifier) @type +(predefined_type) @type.builtin + (class_declaration (type_identifier) @type.class) (extends_clause value: (identifier) @type.class) -(type_identifier) @type -(predefined_type) @type.builtin - ([ (identifier) (shorthand_property_identifier)