@@ -0,0 +1,238 @@
1+;; Methods
2+(method_declaration (identifier) @type (identifier) @function)
3+
4+;; Types
5+(interface_declaration name: (identifier) @type)
6+(class_declaration name: (identifier) @type)
7+(enum_declaration name: (identifier) @type)
8+(struct_declaration (identifier) @type)
9+(record_declaration (identifier) @type)
10+(namespace_declaration name: (identifier) @type)
11+
12+(constructor_declaration name: (identifier) @type)
13+
14+[
15+ (implicit_type)
16+ (nullable_type)
17+ (pointer_type)
18+ (function_pointer_type)
19+ (predefined_type)
20+] @type.builtin
21+
22+;; Enum
23+(enum_member_declaration (identifier) @variable.property)
24+
25+;; Literals
26+[
27+ (real_literal)
28+ (integer_literal)
29+] @number
30+
31+[
32+ (character_literal)
33+ (string_literal)
34+ (verbatim_string_literal)
35+ (interpolated_string_text)
36+ (interpolated_verbatim_string_text)
37+ "\""
38+ "$\""
39+ "@$\""
40+ "$@\""
41+ ] @string
42+
43+[
44+ (boolean_literal)
45+ (null_literal)
46+ (void_keyword)
47+] @constant.builtin
48+
49+;; Comments
50+(comment) @comment
51+
52+;; Tokens
53+[
54+ ";"
55+ "."
56+ ","
57+] @punctuation.delimiter
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+] @operator
88+
89+[
90+ "("
91+ ")"
92+ "["
93+ "]"
94+ "{"
95+ "}"
96+] @punctuation.bracket
97+
98+;; Keywords
99+(modifier) @keyword
100+(this_expression) @keyword
101+(escape_sequence) @keyword
102+
103+[
104+ "as"
105+ "base"
106+ "break"
107+ "case"
108+ "catch"
109+ "checked"
110+ "class"
111+ "continue"
112+ "default"
113+ "delegate"
114+ "do"
115+ "else"
116+ "enum"
117+ "event"
118+ "explicit"
119+ "finally"
120+ "for"
121+ "foreach"
122+ "goto"
123+ "if"
124+ "implicit"
125+ "interface"
126+ "is"
127+ "lock"
128+ "namespace"
129+ "operator"
130+ "params"
131+ "return"
132+ "sizeof"
133+ "stackalloc"
134+ "struct"
135+ "switch"
136+ "throw"
137+ "try"
138+ "typeof"
139+ "unchecked"
140+ "using"
141+ "while"
142+ "new"
143+ "await"
144+ "in"
145+ "yield"
146+ "get"
147+ "set"
148+ "when"
149+ "out"
150+ "ref"
151+ "from"
152+ "where"
153+ "select"
154+ "record"
155+ "init"
156+ "with"
157+ "let"
158+] @keyword
159+
160+
161+;; Linq
162+(from_clause (identifier) @variable)
163+(group_clause)
164+(order_by_clause)
165+(select_clause (identifier) @variable)
166+(query_continuation (identifier) @variable) @keyword
167+
168+;; Record
169+(with_expression
170+ (with_initializer_expression
171+ (simple_assignment_expression
172+ (identifier) @variable)))
173+
174+;; Exprs
175+(binary_expression (identifier) @variable (identifier) @variable)
176+(binary_expression (identifier)* @variable)
177+(conditional_expression (identifier) @variable)
178+(prefix_unary_expression (identifier) @variable)
179+(postfix_unary_expression (identifier)* @variable)
180+(assignment_expression (identifier) @variable)
181+(cast_expression (identifier) @type (identifier) @variable)
182+
183+;; Class
184+(base_list (identifier) @type)
185+(property_declaration (generic_name))
186+(property_declaration
187+ type: (nullable_type) @type
188+ name: (identifier) @variable)
189+(property_declaration
190+ type: (predefined_type) @type
191+ name: (identifier) @variable)
192+(property_declaration
193+ type: (identifier) @type
194+ name: (identifier) @variable)
195+
196+;; Lambda
197+(lambda_expression) @variable
198+
199+;; Attribute
200+(attribute) @type
201+
202+;; Parameter
203+(parameter
204+ type: (identifier) @type
205+ name: (identifier) @variable.parameter)
206+(parameter (identifier) @variable.parameter)
207+(parameter_modifier) @keyword
208+
209+;; Typeof
210+(type_of_expression (identifier) @type)
211+
212+;; Variable
213+(variable_declaration (identifier) @type)
214+(variable_declarator (identifier) @variable)
215+
216+;; Return
217+(return_statement (identifier) @variable)
218+(yield_statement (identifier) @variable)
219+
220+;; Type
221+(generic_name (identifier) @type)
222+(type_parameter (identifier) @variable.parameter)
223+(type_argument_list (identifier) @type)
224+
225+;; Type constraints
226+(type_parameter_constraints_clause (identifier) @variable.parameter)
227+(type_constraint (identifier) @type)
228+
229+;; Exception
230+(catch_declaration (identifier) @type (identifier) @variable)
231+(catch_declaration (identifier) @type)
232+
233+;; Switch
234+(switch_statement (identifier) @variable)
235+(switch_expression (identifier) @variable)
236+
237+;; Lock statement
238+(lock_statement (identifier) @variable)