-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathultimate-js-mode--highlights-ts.el
167 lines (136 loc) · 4.12 KB
/
ultimate-js-mode--highlights-ts.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
(defun ultimate-js-mode--partial-queries-ts (language)
"Custom highlighting queries"
(list
:language language
:feature 'highlight
'((class_declaration
name: (_) @font-lock-function-name-face))
:language language
:feature 'highlight
'((function_signature
name: (identifier) @font-lock-function-name-face
(:match "\\`[A-Z]" @font-lock-function-name-face)))
:language language
:feature 'highlight
'((function_signature
name: (identifier) @font-lock-variable-name-face))
;; Generic type parameters
:language language
:feature 'highlight
'((type_parameter
name: (type_identifier) @font-lock-type-parameter-face))
:language language
:feature 'highlight
'((mapped_type_clause
name: (type_identifier) @font-lock-type-parameter-face))
:language language
:feature 'highlight
"(infer_type . (type_identifier) @font-lock-type-parameter-face)"
;; Type definitions
:language language
:feature 'highlight
'((type_alias_declaration
name: (type_identifier) @font-lock-type-parameter-face))
:language language
:feature 'highlight
'((interface_declaration
name: (type_identifier) @font-lock-type-parameter-face))
;; Other types
:language language
:feature 'highlight
'((type_identifier) @font-lock-type-face)
:language language
:feature 'highlight
'((predefined_type) @font-lock-builtin-face)
:language language
:feature 'highlight
'((type_arguments
"<" @font-lock-bracket-face
">" @font-lock-bracket-face))
:language language
:feature 'highlight
'((type_parameters
"<" @font-lock-bracket-face
">" @font-lock-bracket-face))
;; Properties
:language language
:feature 'highlight
'((method_signature
name: (property_identifier) @font-lock-keyword-face
(:match "\\`constructor\\'" @font-lock-keyword-face)))
:language language
:feature 'highlight
'((property_signature
name: (property_identifier) @font-lock-property.definition-face))
:language language
:feature 'highlight
'((method_signature
name: (property_identifier) @font-lock-property.definition-face))
:language language
:feature 'highlight
'((public_field_definition
name: (property_identifier) @font-lock-property.definition-face))
;; Variables
:language language
:feature 'highlight
'((required_parameter (identifier) @font-lock-variable-name-face))
:language language
:feature 'highlight
'((optional_parameter (identifier) @font-lock-variable-name-face))
:language language
:feature 'highlight
'((import_specifier "type" (identifier) @font-lock-type-parameter-face))
:language language
:feature 'highlight
'((import_statement "import" "type" (import_clause (named_imports (import_specifier (identifier) @font-lock-type-parameter-face)))))
:language language
:feature 'highlight
'((export_specifier "type" (identifier) @font-lock-type-face))
:language language
:feature 'highlight
'((export_statement "export" "type" (export_clause (export_specifier (identifier) @font-lock-type-face))))
;; Keywords
:language language
:feature 'highlight
'([ "abstract"
"declare"
"enum"
"export"
"implements"
"interface"
"keyof"
"namespace"
"private"
"protected"
"public"
"type"
"readonly"
"override"
"infer"
"module"
"extends"
"satisfies"
] @font-lock-keyword-face)
:language language
:feature 'highlight
'((type_predicate
"is" @font-lock-keyword-face))
:language language
:feature 'highlight
'((asserts
"asserts" @font-lock-keyword-face))
:language language
:feature 'highlight
'((ambient_declaration
"global" @font-lock-keyword-face))
:language language
:feature 'highlight
'((as_expression
"const" @font-lock-keyword-face))
:language language
:feature 'highlight
'((template_type
"${" @font-lock-punctuation-face
(_) @font-lock-embedded-face
"}" @font-lock-punctuation-face))))
(provide 'ultimate-js-mode--highlights-ts)