Fix constant highlighting in JS, TypeScript
Previously, SCREAMING_SNAKE_CASE identifiers were highlighted as types due to a mistake in the order of patterns in the highlight queries.
This commit is contained in:
parent
246a6adab7
commit
aba2914a31
2 changed files with 9 additions and 18 deletions
|
@ -43,8 +43,10 @@
|
||||||
|
|
||||||
; Special identifiers
|
; Special identifiers
|
||||||
|
|
||||||
((identifier) @constructor
|
((identifier) @type
|
||||||
(#match? @constructor "^[A-Z]"))
|
(#match? @type "^[A-Z]"))
|
||||||
|
(type_identifier) @type
|
||||||
|
(predefined_type) @type.builtin
|
||||||
|
|
||||||
([
|
([
|
||||||
(identifier)
|
(identifier)
|
||||||
|
@ -192,14 +194,6 @@
|
||||||
"${" @punctuation.special
|
"${" @punctuation.special
|
||||||
"}" @punctuation.special) @embedded
|
"}" @punctuation.special) @embedded
|
||||||
|
|
||||||
; Types
|
|
||||||
|
|
||||||
(type_identifier) @type
|
|
||||||
(predefined_type) @type.builtin
|
|
||||||
|
|
||||||
((identifier) @type
|
|
||||||
(#match? @type "^[A-Z]"))
|
|
||||||
|
|
||||||
(type_arguments
|
(type_arguments
|
||||||
"<" @punctuation.bracket
|
"<" @punctuation.bracket
|
||||||
">" @punctuation.bracket)
|
">" @punctuation.bracket)
|
||||||
|
|
|
@ -46,6 +46,11 @@
|
||||||
((identifier) @constructor
|
((identifier) @constructor
|
||||||
(#match? @constructor "^[A-Z]"))
|
(#match? @constructor "^[A-Z]"))
|
||||||
|
|
||||||
|
((identifier) @type
|
||||||
|
(#match? @type "^[A-Z]"))
|
||||||
|
(type_identifier) @type
|
||||||
|
(predefined_type) @type.builtin
|
||||||
|
|
||||||
([
|
([
|
||||||
(identifier)
|
(identifier)
|
||||||
(shorthand_property_identifier)
|
(shorthand_property_identifier)
|
||||||
|
@ -193,14 +198,6 @@
|
||||||
"${" @punctuation.special
|
"${" @punctuation.special
|
||||||
"}" @punctuation.special) @embedded
|
"}" @punctuation.special) @embedded
|
||||||
|
|
||||||
; Types
|
|
||||||
|
|
||||||
(type_identifier) @type
|
|
||||||
(predefined_type) @type.builtin
|
|
||||||
|
|
||||||
((identifier) @type
|
|
||||||
(#match? @type "^[A-Z]"))
|
|
||||||
|
|
||||||
(type_arguments
|
(type_arguments
|
||||||
"<" @punctuation.bracket
|
"<" @punctuation.bracket
|
||||||
">" @punctuation.bracket)
|
">" @punctuation.bracket)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue