Skip to content

Commit 44317d1

Browse files
JoshTRNmeain
authored andcommitted
Reordered and modified some highlights.
The order of the highlights messed up the variable highlighting and everything was highlighting very weirdly. This PR fixes some of that weirdness.
1 parent 89225ac commit 44317d1

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

queries/haskell/highlights.scm

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,27 @@
3333
;; ----------------------------------------------------------------------------
3434
;; Keywords, operators, includes
3535

36+
(module) @type.builtin
3637
[
3738
"forall"
3839
"∀"
3940
] @repeat
4041

41-
(pragma) @constant.macro
42+
(pragma) @comment
4243

4344
[
4445
"if"
4546
"then"
4647
"else"
4748
"case"
4849
"of"
49-
] @conditional
50+
] @keyword
5051

5152
[
5253
"import"
5354
"qualified"
5455
"module"
55-
] @include
56+
] @keyword
5657

5758
[
5859
(operator)
@@ -103,29 +104,31 @@
103104
;; ----------------------------------------------------------------------------
104105
;; Functions and variables
105106

106-
(variable) @variable
107-
(pat_wildcard) @variable
108107

109-
(signature name: (variable) @type)
110-
(function
111-
name: (variable) @function
112-
patterns: (patterns))
113-
((signature (fun)) . (function (variable) @function))
114-
((signature (context (fun))) . (function (variable) @function))
115-
((signature (forall (context (fun)))) . (function (variable) @function))
108+
(pat_name . (constructor) @constructor)
109+
(pat_wildcard) @operator
110+
;; (pat_apply . (constructor) @constructor)
111+
(signature name: (variable) @function)
112+
;; (function name: (variable) @function patterns: (pat_apply) @constructor)
113+
(function name: (variable) @function.call patterns: (patterns) @variable.parameter)
114+
((signature (fun)) . (function (fun) @function.call))
115+
((signature (context (fun))) . (function (fun) @variable))
116+
((signature (forall (context (fun)))) . (function (variable) @variable))
116117

117118
(exp_infix (variable) @operator) ; consider infix functions as operators
118119

119-
(exp_infix (exp_name) @function (#set! "priority" 101))
120-
(exp_apply . (exp_name (variable) @function))
121-
(exp_apply . (exp_name (qualified_variable (variable) @function)))
120+
(exp_infix (exp_name (variable) @property))
121+
(exp_apply . (exp_name (variable) @function.call))
122+
(exp_apply . (exp_name (qualified_variable (variable) @function.call)))
122123

124+
(record_fields (field (variable) @constant ))
125+
(variable) @variable
123126

124127
;; ----------------------------------------------------------------------------
125128
;; Types
126129

127130
(type) @type
128-
(type_variable) @type
131+
(type_variable) @type.argument
129132

130133
(constructor) @constructor
131134

@@ -136,5 +139,5 @@
136139
;; ----------------------------------------------------------------------------
137140
;; Quasi-quotes
138141

139-
(quoter) @function
142+
(quoter) @function.call
140143
; Highlighting of quasiquote_body is handled by injections.scm

0 commit comments

Comments
 (0)