aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/wit/highlights.scm
blob: 45754a5a8df2d61ad0bc6cdba200eb7646d2b0f6 (plain) (blame)
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
(line_comment) @comment.line
(block_comment) @comment.block
(ty (ident) @type)

(item_type name: (ident) @type)
(item_record name: (ident) @type)
(item_variant name: (ident) @type)
(item_flags name: (ident) @type)
(item_enum name: (ident) @type)
(item_union name: (ident) @type)
(item_resource name: (ident) @type)

(item_use from: (ident) @namespace)
(use_item name: (ident) @type)
(item_func name: (ident) @function)
(method name: (ident) @function.method)
(fields (named_ty name: (ident) @variable.other.member))
(input (args (named_ty name: (ident) @variable.parameter)))
(output (args (named_ty name: (ident) @variable.other.member)))
(flags (ident) @constant)
(enum_items (ident) @constant)
(variant_item tag: (ident) @type.enum.variant)

[
  (unit)

  "u8" "u16" "u32" "u64"
  "s8" "s16" "s32" "s64"
  "float32" "float64"
  "char" "bool" "string"
] @type.builtin

[
  "list"
  "option"
  "result"
  "tuple"
  "future"
  "stream"
] @function.macro

[ "," ":" ] @punctuation.delimiter
[ "(" ")" "{" "}" "<" ">" ] @punctuation.bracket
[ "=" "->" ] @operator

[
  "record"
  "flags"
  "variant"
  "enum"
  "union"
  "type"
  "resource"
] @keyword.storage.type

"func" @keyword

[
  "static"
] @keyword.storage.modifier

[
  (star)
  "use"
  "as"
  "from"
] @keyword.control.import