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

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>
This commit is contained in:
Devzeth 2025-03-02 01:43:51 +01:00 committed by GitHub
parent b0dee94126
commit e00d737196
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 3 deletions

View file

@ -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

View file

@ -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

View file

@ -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