Skip to content

Commit 5cd392a

Browse files
authored
Bring Purescript highlighting closer to Haskell (#592)
1 parent b97e0b9 commit 5cd392a

File tree

1 file changed

+21
-27
lines changed

1 file changed

+21
-27
lines changed

queries/purescript/highlights.scm

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
[
3434
(comma)
3535
";"
36-
(qualified_module) ; grabs the `.` (dot), ex: import System.IO
3736
"."
3837
] @punctuation.delimiter
3938

@@ -47,12 +46,12 @@
4746
"else"
4847
"case"
4948
"of"
50-
] @conditional
49+
] @keyword
5150

5251
[
5352
"import"
5453
"module"
55-
] @include
54+
] @keyword
5655

5756
[
5857
(operator)
@@ -76,19 +75,8 @@
7675
"@"
7776
] @operator
7877

79-
(qualified_module
80-
(module) @constructor)
81-
82-
(module) @namespace
8378

84-
(qualified_type
85-
(module) @namespace)
86-
87-
(qualified_variable
88-
(module) @namespace)
89-
90-
(import
91-
(module) @namespace)
79+
(module) @type.builtin
9280

9381
[
9482
(where)
@@ -132,43 +120,51 @@
132120
(exp_apply
133121
.
134122
(exp_name
135-
(variable) @function))
123+
(variable) @function.call))
136124

137125
(exp_apply
138126
.
139127
(exp_name
140128
(qualified_variable
141-
(variable) @function)))
129+
(variable) @function.call)))
142130

143131
(row_field
144-
(field_name) @field)
132+
(field_name) @constant)
145133

146134
(record_field
147-
(field_name) @field)
135+
(field_name) @constant)
148136

149137
(record_field
150-
(field_pun) @field)
138+
(field_pun) @constant)
151139

152140
(record_accessor
153141
field: [ (variable)
154142
(string)
155143
(triple_quote_string)
156-
] @variable.other.member)
144+
] @variable)
157145

158146
(exp_record_access
159147
field: [ (variable)
160148
(string)
161149
(triple_quote_string)
162-
] @variable.other.member)
150+
] @variable)
151+
152+
(pat_wildcard) @operator
153+
154+
(field_wildcard) @operator
155+
156+
(pat_field (field_name) @constant)
157+
158+
(record_update (field_name) @constant)
163159

164160
(signature
165-
name: (variable) @type)
161+
name: (variable) @function)
166162

167163
(kind_declaration
168164
(class_name) @type)
169165

170166
(function
171-
name: (variable) @function)
167+
name: (variable) @function.call)
172168

173169
(foreign_import
174170
(variable) @function)
@@ -182,9 +178,6 @@
182178
((variable) @boolean
183179
(#any-of? @boolean "true" "false"))
184180

185-
; The former one works for `tree-sitter highlight` but not in Helix/Kakoune.
186-
; The latter two work in Helix (but not Kakoune) and are a good compromise between not highlighting anything at all
187-
; as an operator and leaving it to the child nodes, and highlighting everything as an operator.
188181
(exp_ticked
189182
(_) @operator)
190183

@@ -201,5 +194,6 @@
201194
; Types
202195

203196
(type) @type
197+
(type_variable) @type.argument
204198

205199
(constructor) @constructor

0 commit comments

Comments
 (0)