Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
javascript/typescript/tsx: Highlight private properties (#31527)
Ben Kunkleb4a03989b1c5
diff --git a/crates/languages/src/javascript/highlights.scm b/crates/languages/src/javascript/highlights.scmindex 685bdba3c52..73cb1a5e45b 100644--- a/crates/languages/src/javascript/highlights.scm+++ b/crates/languages/src/javascript/highlights.scm@@ -7,6 +7,7 @@(property_identifier) @property(shorthand_property_identifier) @property(shorthand_property_identifier_pattern) @property+(private_property_identifier) @property; Function and method calls@@ -15,7 +16,7 @@(call_expressionfunction: (member_expression- property: (property_identifier) @function.method))+ property: [(property_identifier) (private_property_identifier)] @function.method)); Function and method definitions@@ -24,18 +25,18 @@(function_declarationname: (identifier) @function)(method_definition- name: (property_identifier) @function.method)+ name: [(property_identifier) (private_property_identifier)] @function.method)(method_definitionname: (property_identifier) @constructor(#eq? @constructor "constructor"))(pair- key: (property_identifier) @function.method+ key: [(property_identifier) (private_property_identifier)] @function.methodvalue: [(function_expression) (arrow_function)])(assignment_expressionleft: (member_expression- property: (property_identifier) @function.method)+ property: [(property_identifier) (private_property_identifier)] @function.method)right: [(function_expression) (arrow_function)])(variable_declarator@@ -248,4 +249,4 @@(jsx_closing_element (["</" ">"]) @punctuation.bracket.jsx)(jsx_self_closing_element (["<" "/>"]) @punctuation.bracket.jsx)(jsx_attribute "=" @punctuation.delimiter.jsx)-(jsx_text) @text.jsx+(jsx_text) @text.jsx\ No newline at end of filediff --git a/crates/languages/src/tsx/highlights.scm b/crates/languages/src/tsx/highlights.scmindex 9a707fa0ceb..e2837c61fda 100644--- a/crates/languages/src/tsx/highlights.scm+++ b/crates/languages/src/tsx/highlights.scm@@ -7,6 +7,7 @@(property_identifier) @property(shorthand_property_identifier) @property(shorthand_property_identifier_pattern) @property+(private_property_identifier) @property; Function and method calls@@ -15,7 +16,7 @@(call_expressionfunction: (member_expression- property: (property_identifier) @function.method))+ property: [(property_identifier) (private_property_identifier)] @function.method)); Function and method definitions@@ -24,18 +25,18 @@(function_declarationname: (identifier) @function)(method_definition- name: (property_identifier) @function.method)+ name: [(property_identifier) (private_property_identifier)] @function.method)(method_definitionname: (property_identifier) @constructor(#eq? @constructor "constructor"))(pair- key: (property_identifier) @function.method+ key: [(property_identifier) (private_property_identifier)] @function.methodvalue: [(function_expression) (arrow_function)])(assignment_expressionleft: (member_expression- property: (property_identifier) @function.method)+ property: [(property_identifier) (private_property_identifier)] @function.method)right: [(function_expression) (arrow_function)])(variable_declarator@@ -254,4 +255,4 @@(jsx_closing_element (["</" ">"]) @punctuation.bracket.jsx)(jsx_self_closing_element (["<" "/>"]) @punctuation.bracket.jsx)(jsx_attribute "=" @punctuation.delimiter.jsx)-(jsx_text) @text.jsx+(jsx_text) @text.jsx\ No newline at end of filediff --git a/crates/languages/src/typescript/highlights.scm b/crates/languages/src/typescript/highlights.scmindex 9c7289bd0f3..486e5a76845 100644--- a/crates/languages/src/typescript/highlights.scm+++ b/crates/languages/src/typescript/highlights.scm@@ -39,6 +39,7 @@(property_identifier) @property(shorthand_property_identifier) @property(shorthand_property_identifier_pattern) @property+(private_property_identifier) @property; Function and method calls@@ -47,7 +48,7 @@(call_expressionfunction: (member_expression- property: (property_identifier) @function.method))+ property: [(property_identifier) (private_property_identifier)] @function.method)); Function and method definitions@@ -56,18 +57,18 @@(function_declarationname: (identifier) @function)(method_definition- name: (property_identifier) @function.method)+ name: [(property_identifier) (private_property_identifier)] @function.method)(method_definitionname: (property_identifier) @constructor(#eq? @constructor "constructor"))(pair- key: (property_identifier) @function.method+ key: [(property_identifier) (private_property_identifier)] @function.methodvalue: [(function_expression) (arrow_function)])(assignment_expressionleft: (member_expression- property: (property_identifier) @function.method)+ property: [(property_identifier) (private_property_identifier)] @function.method)right: [(function_expression) (arrow_function)])(variable_declarator@@ -270,4 +271,4 @@"while""with""yield"-] @keyword+] @keyword\ No newline at end of file