mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
JS/TS highlighting improvements (#3219)
This commit is contained in:
parent
85a5df0391
commit
bf74a4652d
@ -66,6 +66,8 @@
|
||||
;-----------
|
||||
|
||||
(property_identifier) @variable.other.member
|
||||
(shorthand_property_identifier) @variable.other.member
|
||||
(shorthand_property_identifier_pattern) @variable.other.member
|
||||
|
||||
; Literals
|
||||
;---------
|
||||
@ -149,8 +151,11 @@
|
||||
"&&="
|
||||
"||="
|
||||
"??="
|
||||
"..."
|
||||
] @operator
|
||||
|
||||
(ternary_expression ["?" ":"] @operator)
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
|
@ -1,28 +1,36 @@
|
||||
; inherits: javascript
|
||||
; Namespaces
|
||||
|
||||
; Types
|
||||
(internal_module
|
||||
[((identifier) @namespace) ((nested_identifier (identifier) @namespace))])
|
||||
|
||||
(type_identifier) @type
|
||||
(predefined_type) @type.builtin
|
||||
(ambient_declaration "global" @namespace)
|
||||
|
||||
((identifier) @type
|
||||
(#match? @type "^[A-Z]"))
|
||||
|
||||
(type_arguments
|
||||
"<" @punctuation.bracket
|
||||
">" @punctuation.bracket)
|
||||
|
||||
; Variables
|
||||
|
||||
(required_parameter (identifier) @variable.parameter)
|
||||
(optional_parameter (identifier) @variable.parameter)
|
||||
|
||||
; Punctuation
|
||||
|
||||
[
|
||||
":"
|
||||
] @punctuation.delimiter
|
||||
|
||||
(optional_parameter "?" @punctuation.special)
|
||||
(property_signature "?" @punctuation.special)
|
||||
|
||||
(conditional_type ["?" ":"] @operator)
|
||||
|
||||
|
||||
|
||||
; Keywords
|
||||
|
||||
[
|
||||
"abstract"
|
||||
"declare"
|
||||
"export"
|
||||
"infer"
|
||||
"implements"
|
||||
"keyof"
|
||||
"namespace"
|
||||
@ -39,4 +47,18 @@
|
||||
"private"
|
||||
"protected"
|
||||
"readonly"
|
||||
] @keyword.storage.modifier
|
||||
] @keyword.storage.modifier
|
||||
|
||||
; inherits: javascript
|
||||
|
||||
; Types
|
||||
|
||||
(type_identifier) @type
|
||||
(predefined_type) @type.builtin
|
||||
|
||||
(type_arguments
|
||||
"<" @punctuation.bracket
|
||||
">" @punctuation.bracket)
|
||||
|
||||
((identifier) @type
|
||||
(#match? @type "^[A-Z]"))
|
||||
|
Loading…
Reference in New Issue
Block a user