diff --git a/crates/languages/src/javascript/highlights.scm b/crates/languages/src/javascript/highlights.scm index 9986390b4e..f46db408e7 100644 --- a/crates/languages/src/javascript/highlights.scm +++ b/crates/languages/src/javascript/highlights.scm @@ -25,6 +25,9 @@ name: (identifier) @function) (method_definition name: (property_identifier) @function.method) +(method_definition + name: (property_identifier) @constructor + (#eq? @constructor "constructor")) (pair key: (property_identifier) @function.method diff --git a/crates/languages/src/tsx/highlights.scm b/crates/languages/src/tsx/highlights.scm index d21f0c2147..5b83ec903c 100644 --- a/crates/languages/src/tsx/highlights.scm +++ b/crates/languages/src/tsx/highlights.scm @@ -25,6 +25,9 @@ name: (identifier) @function) (method_definition name: (property_identifier) @function.method) +(method_definition + name: (property_identifier) @constructor + (#eq? @constructor "constructor")) (pair key: (property_identifier) @function.method @@ -45,9 +48,6 @@ ; Special identifiers -((identifier) @constructor - (#match? @constructor "^[A-Z]")) - ((identifier) @type (#match? @type "^[A-Z]")) (type_identifier) @type diff --git a/crates/languages/src/typescript/highlights.scm b/crates/languages/src/typescript/highlights.scm index bccb22fa9c..502957c93b 100644 --- a/crates/languages/src/typescript/highlights.scm +++ b/crates/languages/src/typescript/highlights.scm @@ -57,6 +57,9 @@ name: (identifier) @function) (method_definition name: (property_identifier) @function.method) +(method_definition + name: (property_identifier) @constructor + (#eq? @constructor "constructor")) (pair key: (property_identifier) @function.method