on master help sign in
bump tree-sitter-haskell and update queries (#8558)
814cf17Ryan Mehri
languages.toml+1−1
@@ -1094,7 +1094,7 @@ indent = { tab-width = 2, unit = " " }
1094
1094
1095[[grammar]]
1095[[grammar]]
1096name = "haskell"
1096name = "haskell"
1097−source = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "98fc7f59049aeb713ab9b72a8ff25dcaaef81087" }
1097+source = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "d7ac98f49e3ed7e17541256fe3881a967d7ffdd3" }
1098
1098
1099[[language]]
1099[[language]]
1100name = "haskell-persistent"
1100name = "haskell-persistent"
runtime/queries/haskell/highlights.scm+24−11
@@ -33,6 +33,11 @@
33;; ----------------------------------------------------------------------------
33;; ----------------------------------------------------------------------------
34;; Keywords, operators, includes
34;; Keywords, operators, includes
35
35
36+[
37+ "forall"
38+ "∀"
39+] @keyword.control.repeat
40+
36(pragma) @constant.macro
41(pragma) @constant.macro
37
42
38[
43[
@@ -68,10 +73,7 @@
68 "@"
73 "@"
69] @operator
74] @operator
70
75
71−(qualified_module (module) @constructor)
72−(qualified_type (module) @namespace)
76+(module) @namespace
73−(qualified_variable (module) @namespace)
74−(import (module) @namespace)
75
77
76[
78[
77 (where)
79 (where)
@@ -92,8 +94,6 @@
92 "do"
94 "do"
93 "mdo"
95 "mdo"
94 "rec"
96 "rec"
95− "forall"
96− "∀"
97 "infix"
97 "infix"
98 "infixl"
98 "infixl"
99 "infixr"
99 "infixr"
@@ -104,22 +104,35 @@
104;; Functions and variables
104;; Functions and variables
105
105
106(signature name: (variable) @type)
106(signature name: (variable) @type)
107+(function
107−(function name: (variable) @function)
108+ name: (variable) @function
108−
109+ patterns: (patterns))
109−(variable) @variable
110+((signature (fun)) . (function (variable) @function))
110−"_" @variable.builtin
111+((signature (context (fun))) . (function (variable) @function))
112+((signature (forall (context (fun)))) . (function (variable) @function))
111
113
112(exp_infix (variable) @operator) ; consider infix functions as operators
114(exp_infix (variable) @operator) ; consider infix functions as operators
113
115
114−("@" @namespace) ; "as" pattern operator, e.g. x@Constructor
116+(exp_infix (exp_name) @function)
117+(exp_apply . (exp_name (variable) @function))
118+(exp_apply . (exp_name (qualified_variable (variable) @function)))
115
119
120+(variable) @variable
121+(pat_wildcard) @variable
116
122
117;; ----------------------------------------------------------------------------
123;; ----------------------------------------------------------------------------
118;; Types
124;; Types
119
125
120(type) @type
126(type) @type
127+(type_variable) @type
121
128
122(constructor) @constructor
129(constructor) @constructor
123
130
124; True or False
131; True or False
125((constructor) @_bool (#match? @_bool "(True|False)")) @constant.builtin.boolean
132((constructor) @_bool (#match? @_bool "(True|False)")) @constant.builtin.boolean
133+
134+;; ----------------------------------------------------------------------------
135+;; Quasi-quotes
136+
137+(quoter) @function
138+; Highlighting of quasiquote_body is handled by injections.scm