Skip to repository content479 lines · 7.9 KB · text
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T04:10:44.686Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
highlights.scm
1; Variables
2(identifier) @variable
3
4(call_expression
5 function: (member_expression
6 object: (identifier) @type
7 (#any-of? @type
8 "Promise" "Array" "Object" "Map" "Set" "WeakMap" "WeakSet" "Date" "Error" "TypeError"
9 "RangeError" "SyntaxError" "ReferenceError" "EvalError" "URIError" "RegExp" "Function"
10 "Number" "String" "Boolean" "Symbol" "BigInt" "Proxy" "ArrayBuffer" "DataView")))
11
12; Special identifiers
13(type_annotation) @type
14
15(type_identifier) @type
16
17(predefined_type) @type.builtin
18
19(type_alias_declaration
20 (type_identifier) @type)
21
22(type_alias_declaration
23 value: (_
24 (type_identifier) @type))
25
26(interface_declaration
27 (type_identifier) @type)
28
29(class_declaration
30 (type_identifier) @type.class)
31
32(extends_clause
33 value: (identifier) @type.class)
34
35(extends_type_clause
36 type: (type_identifier) @type)
37
38(implements_clause
39 (type_identifier) @type)
40
41; Enables ts-pretty-errors
42; The Lsp returns "snippets" of typescript, which are not valid typescript in totality,
43; but should still be highlighted
44; Highlights object literals by hijacking the statement_block pattern, but only if
45; the statement block follows an object literal pattern
46(statement_block
47 (labeled_statement
48 ; highlight the label like a property name
49 label: (statement_identifier) @property.name
50 body: [
51 ; match a terminating expression statement
52 (expression_statement
53 ; single identifier - treat as a type name
54 [
55 (identifier) @type.name
56 ; object - treat as a property - type pair
57 (object
58 (pair
59 key: (_) @property.name
60 value: (_) @type.name))
61 ; subscript_expression - treat as an array declaration
62 (subscript_expression
63 object: (_) @type.name
64 index: (_))
65 ; templated string - treat each identifier contained as a type name
66 (template_string
67 (template_substitution
68 (identifier) @type.name))
69 ])
70 ; match a nested statement block
71 (statement_block) @nested
72 ]))
73
74; Inline type imports: import { type Foo } or import { type Foo as Bar }
75(import_specifier
76 "type"
77 name: (identifier) @type)
78
79(import_specifier
80 "type"
81 alias: (identifier) @type)
82
83; Full type imports: import type { Foo } or import type { Foo as Bar }
84(import_statement
85 "type"
86 (import_clause
87 (named_imports
88 (import_specifier
89 name: (identifier) @type))))
90
91(import_statement
92 "type"
93 (import_clause
94 (named_imports
95 (import_specifier
96 alias: (identifier) @type))))
97
98([
99 (identifier)
100 (shorthand_property_identifier)
101 (shorthand_property_identifier_pattern)
102] @constant
103 (#match? @constant "^_*[A-Z_][A-Z\\d_]*$"))
104
105; Properties
106(property_identifier) @property
107
108(shorthand_property_identifier) @property
109
110(shorthand_property_identifier_pattern) @property
111
112(private_property_identifier) @property
113
114; Function and method calls
115(call_expression
116 function: (identifier) @function)
117
118(call_expression
119 function: (member_expression
120 property: [
121 (property_identifier)
122 (private_property_identifier)
123 ] @function.method))
124
125(new_expression
126 constructor: (identifier) @type)
127
128(nested_type_identifier
129 module: (identifier) @type)
130
131; Function and method definitions
132(function_expression
133 name: (identifier) @function)
134
135(function_declaration
136 name: (identifier) @function)
137
138(method_definition
139 name: [
140 (property_identifier)
141 (private_property_identifier)
142 ] @function.method)
143
144(method_definition
145 name: (property_identifier) @constructor
146 (#eq? @constructor "constructor"))
147
148(pair
149 key: [
150 (property_identifier)
151 (private_property_identifier)
152 ] @function.method
153 value: [
154 (function_expression)
155 (arrow_function)
156 ])
157
158(assignment_expression
159 left: (member_expression
160 property: [
161 (property_identifier)
162 (private_property_identifier)
163 ] @function.method)
164 right: [
165 (function_expression)
166 (arrow_function)
167 ])
168
169(variable_declarator
170 name: (identifier) @function
171 value: [
172 (function_expression)
173 (arrow_function)
174 ])
175
176(assignment_expression
177 left: (identifier) @function
178 right: [
179 (function_expression)
180 (arrow_function)
181 ])
182
183(arrow_function) @function
184
185; Parameters
186(required_parameter
187 (identifier) @variable.parameter)
188
189(required_parameter
190 (_
191 ([
192 (identifier)
193 (shorthand_property_identifier_pattern)
194 ]) @variable.parameter))
195
196(required_parameter
197 (_
198 (object_assignment_pattern
199 left: (shorthand_property_identifier_pattern) @variable.parameter)))
200
201(required_parameter
202 (_
203 (assignment_pattern
204 left: (identifier) @variable.parameter)))
205
206(optional_parameter
207 (_
208 (object_assignment_pattern
209 left: (shorthand_property_identifier_pattern) @variable.parameter)))
210
211(optional_parameter
212 (_
213 (assignment_pattern
214 left: (identifier) @variable.parameter)))
215
216(optional_parameter
217 (identifier) @variable.parameter)
218
219(optional_parameter
220 (_
221 ([
222 (identifier)
223 (shorthand_property_identifier_pattern)
224 ]) @variable.parameter))
225
226(catch_clause
227 parameter: (identifier) @variable.parameter)
228
229(index_signature
230 name: (identifier) @variable.parameter)
231
232(arrow_function
233 parameter: (identifier) @variable.parameter)
234
235(type_predicate
236 name: (identifier) @variable.parameter)
237
238; Literals
239(this) @variable.special
240
241(super) @variable.special
242
243[
244 (null)
245 (undefined)
246] @constant.builtin
247
248[
249 (true)
250 (false)
251] @boolean
252
253(literal_type
254 [
255 (null)
256 (undefined)
257 (true)
258 (false)
259 ] @type.builtin)
260
261(comment) @comment
262
263(hash_bang_line) @comment
264
265[
266 (string)
267 (template_string)
268 (template_literal_type)
269] @string
270
271(escape_sequence) @string.escape
272
273(regex) @string.regex
274
275(regex_flags) @keyword.operator.regex
276
277(number) @number
278
279; Tokens
280[
281 ";"
282 "?."
283 "."
284 ","
285 ":"
286 "?"
287] @punctuation.delimiter
288
289[
290 "..."
291 "-"
292 "--"
293 "-="
294 "+"
295 "++"
296 "+="
297 "*"
298 "*="
299 "**"
300 "**="
301 "/"
302 "/="
303 "%"
304 "%="
305 "<"
306 "<="
307 "<<"
308 "<<="
309 "="
310 "=="
311 "==="
312 "!"
313 "!="
314 "!=="
315 "=>"
316 ">"
317 ">="
318 ">>"
319 ">>="
320 ">>>"
321 ">>>="
322 "~"
323 "^"
324 "&"
325 "|"
326 "^="
327 "&="
328 "|="
329 "&&"
330 "||"
331 "??"
332 "&&="
333 "||="
334 "??="
335 "..."
336] @operator
337
338(regex
339 "/" @string.regex)
340
341(ternary_expression
342 [
343 "?"
344 ":"
345 ] @operator)
346
347[
348 "("
349 ")"
350 "["
351 "]"
352 "{"
353 "}"
354] @punctuation.bracket
355
356(template_substitution
357 "${" @punctuation.special
358 "}" @punctuation.special) @embedded
359
360(template_type
361 "${" @punctuation.special
362 "}" @punctuation.special) @embedded
363
364(type_arguments
365 "<" @punctuation.bracket
366 ">" @punctuation.bracket)
367
368(type_parameters
369 "<" @punctuation.bracket
370 ">" @punctuation.bracket)
371
372(decorator
373 "@" @punctuation.special)
374
375(union_type
376 "|" @punctuation.special)
377
378(intersection_type
379 "&" @punctuation.special)
380
381(type_annotation
382 ":" @punctuation.special)
383
384(index_signature
385 ":" @punctuation.special)
386
387(type_predicate_annotation
388 ":" @punctuation.special)
389
390(public_field_definition
391 "?" @punctuation.special)
392
393(property_signature
394 "?" @punctuation.special)
395
396(method_signature
397 "?" @punctuation.special)
398
399(optional_parameter
400 ([
401 "?"
402 ":"
403 ]) @punctuation.special)
404
405; Keywords
406[
407 "abstract"
408 "as"
409 "async"
410 "debugger"
411 "declare"
412 "default"
413 "delete"
414 "extends"
415 "get"
416 "implements"
417 "in"
418 "infer"
419 "instanceof"
420 "is"
421 "keyof"
422 "module"
423 "namespace"
424 "new"
425 "of"
426 "override"
427 "private"
428 "protected"
429 "public"
430 "readonly"
431 "satisfies"
432 "set"
433 "static"
434 "target"
435 "typeof"
436 "using"
437 "void"
438 "with"
439] @keyword
440
441[
442 "const"
443 "let"
444 "var"
445 "function"
446 "class"
447 "enum"
448 "interface"
449 "type"
450] @keyword.declaration
451
452[
453 "export"
454 "from"
455 "import"
456] @keyword.import
457
458[
459 "await"
460 "break"
461 "case"
462 "catch"
463 "continue"
464 "do"
465 "else"
466 "finally"
467 "for"
468 "if"
469 "return"
470 "switch"
471 "throw"
472 "try"
473 "while"
474 "yield"
475] @keyword.control
476
477(switch_default
478 "default" @keyword.control)
479