Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Improve JS/TS/TSX parameter highlighting for destructuring (#60767)
feeiyu5d8459eed6fc
diff --git a/crates/grammars/src/javascript/highlights.scm b/crates/grammars/src/javascript/highlights.scmindex 85256490987..336fcdd36a5 100644--- a/crates/grammars/src/javascript/highlights.scm+++ b/crates/grammars/src/javascript/highlights.scm@@ -98,6 +98,26 @@(shorthand_property_identifier_pattern)]) @variable.parameter))+(required_parameter+ (_+ (object_assignment_pattern+ left: (shorthand_property_identifier_pattern) @variable.parameter)))++(required_parameter+ (_+ (assignment_pattern+ left: (identifier) @variable.parameter)))++(optional_parameter+ (_+ (object_assignment_pattern+ left: (shorthand_property_identifier_pattern) @variable.parameter)))++(optional_parameter+ (_+ (assignment_pattern+ left: (identifier) @variable.parameter)))+(optional_parameter(identifier) @variable.parameter)diff --git a/crates/grammars/src/tsx/highlights.scm b/crates/grammars/src/tsx/highlights.scmindex e8cb7a11065..3dd9038782d 100644--- a/crates/grammars/src/tsx/highlights.scm+++ b/crates/grammars/src/tsx/highlights.scm@@ -98,6 +98,26 @@(shorthand_property_identifier_pattern)]) @variable.parameter))+(required_parameter+ (_+ (object_assignment_pattern+ left: (shorthand_property_identifier_pattern) @variable.parameter)))++(required_parameter+ (_+ (assignment_pattern+ left: (identifier) @variable.parameter)))++(optional_parameter+ (_+ (object_assignment_pattern+ left: (shorthand_property_identifier_pattern) @variable.parameter)))++(optional_parameter+ (_+ (assignment_pattern+ left: (identifier) @variable.parameter)))+(optional_parameter(identifier) @variable.parameter)diff --git a/crates/grammars/src/typescript/highlights.scm b/crates/grammars/src/typescript/highlights.scmindex 0213adb10f6..c3ecf179465 100644--- a/crates/grammars/src/typescript/highlights.scm+++ b/crates/grammars/src/typescript/highlights.scm@@ -193,6 +193,26 @@(shorthand_property_identifier_pattern)]) @variable.parameter))+(required_parameter+ (_+ (object_assignment_pattern+ left: (shorthand_property_identifier_pattern) @variable.parameter)))++(required_parameter+ (_+ (assignment_pattern+ left: (identifier) @variable.parameter)))++(optional_parameter+ (_+ (object_assignment_pattern+ left: (shorthand_property_identifier_pattern) @variable.parameter)))++(optional_parameter+ (_+ (assignment_pattern+ left: (identifier) @variable.parameter)))+(optional_parameter(identifier) @variable.parameter)