Add `constructor` highlighting for JS/TS/TSX (#25207)

Devzeth and Ben Kunkle created

Closes #19267

Adds highlight field specifically for `constructor` in JS/TS/TSX so that
it can be highlighted as a different color than regular methods

Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>

Change summary

crates/languages/src/javascript/highlights.scm | 3 +++
crates/languages/src/tsx/highlights.scm        | 6 +++---
crates/languages/src/typescript/highlights.scm | 3 +++
3 files changed, 9 insertions(+), 3 deletions(-)

Detailed changes

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

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

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