aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/unison/highlights.scm
blob: 5fa721046b4a5f32b020e7303d1d263aac6d6279 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
; Primitives
(comment) @comment @spell

(nat) @number

(unit) @constant.builtin

(literal_char) @character

(literal_text) @string

(literal_boolean) @boolean

; Keywords
(type_kw) @keyword.type

[
  (kw_forall)
  (do)
  (kw_let)
  (ability)
  (where)
] @keyword

(structural) @keyword.modifier

(unique) @keyword.modifier

(type_constructor) @constructor

((doc_block) @comment.documentation @spell
  (#set! priority 90))

[
  (operator)
  (pipe)
  (arrow_symbol)
  (or)
  (kw_equals)
] @operator

[
  "if"
  "else"
  "then"
  (match)
  (with)
  (cases)
] @keyword.conditional

(blank_pattern) @variable.builtin

(pattern) @variable

(use_clause) @keyword.import

; Types
(record_field
  (field_name) @variable.member
  type: (regular_identifier) @type)

(type_name) @type

(type_declaration
  (regular_identifier) @type)

(ability_name
  (path)? @module
  (regular_identifier) @type)

(ability_declaration
  (ability_name) @type
  (type_argument) @variable.parameter)

(constructor
  (constructor_name) @constructor)

(constructor
  type: (regular_identifier) @type)

(effect
  (regular_identifier) @attribute) ; NOTE: an effect is a special type

; Namespaces
(path) @module

(namespace) @module

; Terms
(type_signature
  term_name: (path) @module
  term_name: (regular_identifier) @variable)

(type_signature
  term_name: (regular_identifier) @variable)

(term_type) @type

(term_definition
  name: (path) @module)

(term_definition
  name: (regular_identifier) @variable)

(term_definition
  param: (regular_identifier) @variable.parameter)

; Punctuation
[
  (type_signature_colon)
  ":"
] @punctuation.delimiter

[
  "("
  ")"
  "{"
  "}"
  "["
  "]"
] @punctuation.bracket

(watch_expression) @keyword.directive

(test_watch_expression) @keyword.directive