@@ -0,0 +1,218 @@
1+; highlights.scm
2+
3+; highlight constants
4+(
5+ (member_access_expression (identifier) @constant)
6+ (#match? @constant "^[A-Z][A-Z_0-9]*$")
7+)
8+
9+(
10+ (member_access_expression (member_access_expression) @namespace (identifier) @constant)
11+ (#match? @constant "^[A-Z][A-Z_0-9]*$")
12+)
13+
14+(comment) @comment
15+
16+(type (symbol (_)? @namespace (identifier) @type))
17+
18+; highlight creation methods in object creation expressions
19+(
20+ (object_creation_expression (type (symbol (symbol (symbol)? @namespace (identifier) @type) (identifier) @constructor)))
21+ (#match? @constructor "^[a-z][a-z_0-9]*$")
22+)
23+
24+(unqualified_type (symbol . (identifier) @type))
25+(unqualified_type (symbol (symbol) @namespace (identifier) @type))
26+
27+(attribute) @variable.other.member
28+(method_declaration (symbol (symbol) @type (identifier) @function))
29+(method_declaration (symbol (identifier) @function))
30+(local_function_declaration (identifier) @function)
31+(destructor_declaration (identifier) @function)
32+(creation_method_declaration (symbol (symbol (identifier) @type) (identifier) @constructor))
33+(creation_method_declaration (symbol (identifier) @constructor))
34+(enum_declaration (symbol) @type)
35+(enum_value (identifier) @constant)
36+(errordomain_declaration (symbol) @type)
37+(errorcode (identifier) @constant)
38+(constant_declaration (identifier) @constant)
39+(method_call_expression (member_access_expression (identifier) @function))
40+(lambda_expression (identifier) @variable.parameter)
41+(parameter (identifier) @variable.parameter)
42+(property_declaration (symbol (identifier) @variable.other.member))
43+(field_declaration (identifier) @variable)
44+(identifier) @variable
45+[
46+ (this_access)
47+ (base_access)
48+ (value_access)
49+] @variable.builtin
50+(boolean) @constant.builtin.boolean
51+(character) @constant.character
52+(integer) @constant.numeric.integer
53+(null) @constant.builtin
54+(real) @constant.numeric.float
55+(regex) @string.regexp
56+(string) @string
57+[
58+ (escape_sequence)
59+ (string_formatter)
60+] @string.special
61+(template_string) @string
62+(template_string_expression) @string.special
63+(verbatim_string) @string
64+[
65+ "var"
66+ "void"
67+] @type.builtin
68+
69+[
70+ "abstract"
71+ "async"
72+ "break"
73+ "case"
74+ "catch"
75+ "class"
76+ "const"
77+ "construct"
78+ "continue"
79+ "default"
80+ "delegate"
81+ "do"
82+ "dynamic"
83+ "else"
84+ "enum"
85+ "errordomain"
86+ "extern"
87+ "finally"
88+ "for"
89+ "foreach"
90+ "get"
91+ "if"
92+ "inline"
93+ "interface"
94+ "internal"
95+ "lock"
96+ "namespace"
97+ "new"
98+ "out"
99+ "override"
100+ "owned"
101+ "partial"
102+ "private"
103+ "protected"
104+ "public"
105+ "ref"
106+ "set"
107+ "signal"
108+ "static"
109+ "struct"
110+ "switch"
111+ "throw"
112+ "throws"
113+ "try"
114+ "unowned"
115+ "virtual"
116+ "weak"
117+ "while"
118+ "with"
119+] @keyword
120+
121+[
122+ "and"
123+ "as"
124+ "delete"
125+ "in"
126+ "is"
127+ "not"
128+ "or"
129+ "sizeof"
130+ "typeof"
131+] @keyword.operator
132+
133+"using" @namespace
134+
135+(symbol "global::" @namespace)
136+
137+(array_creation_expression "new" @keyword.operator)
138+(object_creation_expression "new" @keyword.operator)
139+(argument "out" @keyword.operator)
140+(argument "ref" @keyword.operator)
141+
142+[
143+ "continue"
144+ "do"
145+ "for"
146+ "foreach"
147+ "while"
148+] @keyword.control.repeat
149+
150+[
151+ "catch"
152+ "finally"
153+ "throw"
154+ "throws"
155+ "try"
156+] @keyword.control.exception
157+
158+[
159+ "return"
160+ "yield"
161+] @keyword.control.return
162+
163+[
164+ "="
165+ "=="
166+ "+"
167+ "+="
168+ "-"
169+ "-="
170+ "++"
171+ "--"
172+ "|"
173+ "|="
174+ "&"
175+ "&="
176+ "^"
177+ "^="
178+ "/"
179+ "/="
180+ "*"
181+ "*="
182+ "%"
183+ "%="
184+ "<<"
185+ "<<="
186+ ">>"
187+ ">>="
188+ "."
189+ "?."
190+ "->"
191+ "!"
192+ "!="
193+ "~"
194+ "??"
195+ "?"
196+ ":"
197+ "<"
198+ "<="
199+ ">"
200+ ">="
201+ "||"
202+ "&&"
203+ "=>"
204+] @operator
205+
206+[
207+ ","
208+ ";"
209+] @punctuation.delimiter
210+
211+[
212+ "("
213+ ")"
214+ "{"
215+ "}"
216+ "["
217+ "]"
218+] @punctuation.bracket