@@ -33,6 +33,26 @@
3333(type_definition
3434 name: (type_identifier) @type)
3535
36+(full_enum_case
37+ name: (identifier) @type)
38+
39+(simple_enum_case
40+ name: (identifier) @type)
41+
42+;; val/var definitions/declarations
43+
44+(val_definition
45+ pattern: (identifier) @variable)
46+
47+(var_definition
48+ pattern: (identifier) @variable)
49+
50+(val_declaration
51+ name: (identifier) @variable)
52+
53+(var_declaration
54+ name: (identifier) @variable)
55+
3656; method definition
3757
3858(class_definition
@@ -48,7 +68,7 @@
4868 (function_definition
4969 name: (identifier) @function.method)))
5070
51−; imports
71+; imports/exports
5272
5373(import_declaration
5474 path: (identifier) @namespace)
@@ -58,7 +78,15 @@
5878 path: (identifier) @type) (#match? @type "^[A-Z]"))
5979((stable_identifier (identifier) @type) (#match? @type "^[A-Z]"))
6080
61−((import_selectors (identifier) @type) (#match? @type "^[A-Z]"))
81+(export_declaration
82+ path: (identifier) @namespace)
83+((stable_identifier (identifier) @namespace))
84+
85+((export_declaration
86+ path: (identifier) @type) (#match? @type "^[A-Z]"))
87+((stable_identifier (identifier) @type) (#match? @type "^[A-Z]"))
88+
89+((namespace_selectors (identifier) @type) (#match? @type "^[A-Z]"))
6290
6391; method invocation
6492
@@ -66,10 +94,17 @@
6694(call_expression
6795 function: (identifier) @function)
6896
97+(call_expression
98+ function: (operator_identifier) @function)
99+
69100(call_expression
70101 function: (field_expression
71102 field: (identifier) @function.method))
72103
104+(call_expression
105+ function: (field_expression
106+ field: (operator_identifier) @function.method))
107+
73108((call_expression
74109 function: (identifier) @variable.other.member)
75110 (#match? @variable.other.member "^[A-Z]"))
@@ -87,9 +122,15 @@
87122(function_definition
88123 name: (identifier) @function)
89124
125+(function_definition
126+ name: (operator_identifier) @function)
127+
90128(parameter
91129 name: (identifier) @variable.parameter)
92130
131+(binding
132+ name: (identifier) @variable.parameter)
133+
93134; expressions
94135
95136
@@ -109,7 +150,7 @@
109150
110151
111152(symbol_literal) @string.special.symbol
112−
153+
113154[
114155(string)
115156(character_literal)
@@ -118,29 +159,50 @@
118159
119160(interpolation "$" @punctuation.special)
120161
162+; annotations
163+
164+(annotation) @attribute
165+
121166;; keywords
122167
168+;; storage in TextMate scope lingo means field or type
123169[
170+ (opaque_modifier)
171+ (infix_modifier)
172+ (transparent_modifier)
173+ (open_modifier)
124174 "abstract"
125− "case"
126− "class"
127− "extends"
128175 "final"
129− "finally"
130−;; `forSome` existential types not implemented yet
131176 "implicit"
132177 "lazy"
133−;; `macro` not implemented yet
134− "object"
135178 "override"
136− "package"
137179 "private"
138180 "protected"
139181 "sealed"
182+] @keyword.storage.modifier
183+
184+[
185+ "class"
186+ "enum"
187+ "extension"
188+ "given"
189+ "object"
190+ "package"
140191 "trait"
141192 "type"
142193 "val"
143194 "var"
195+] @keyword.storage.type
196+
197+[
198+ "as"
199+ "derives"
200+ "end"
201+ "extends"
202+;; `forSome` existential types not implemented yet
203+;; `macro` not implemented yet
204+;; `throws`
205+ "using"
144206 "with"
145207] @keyword
146208
@@ -152,33 +214,36 @@
152214"new" @keyword.operator
153215
154216[
155− "else"
156− "if"
157− "match"
158− "try"
159− "catch"
160− "throw"
217+ "case"
218+ "catch"
219+ "else"
220+ "finally"
221+ "if"
222+ "match"
223+ "then"
224+ "throw"
225+ "try"
161226] @keyword.control.conditional
162227
163228[
164− "("
165− ")"
166− "["
167− "]"
168− "{"
169− "}"
229+ "("
230+ ")"
231+ "["
232+ "]"
233+ "{"
234+ "}"
170235] @punctuation.bracket
171236
172237[
173− "."
174− ","
238+ "."
239+ ","
175240] @punctuation.delimiter
176241
177242[
178− "do"
179− "for"
180− "while"
181− "yield"
243+ "do"
244+ "for"
245+ "while"
246+ "yield"
182247] @keyword.control.repeat
183248
184249"def" @keyword.function
@@ -191,6 +256,8 @@
191256
192257"import" @keyword.control.import
193258
259+"export" @keyword.control.import
260+
194261"return" @keyword.control.return
195262
196263(comment) @comment
@@ -200,4 +267,6 @@
200267(case_block
201268 (case_clause ("case") @keyword.control.conditional))
202269
203−(identifier) @variable
270+(identifier) @variable
271+
272+(operator_identifier) @operator