aboutsummaryrefslogtreecommitdiffstats
path: root/queries/haskell
diff options
context:
space:
mode:
authorAnanda Umamil <zweimach@zweimach.org>2022-01-08 11:12:08 +0700
committerStephan Seitz <stephan.seitz@fau.de>2022-01-08 12:37:11 +0100
commit50fee51d352317aaed28532c5f2f3f5e44fdd7bc (patch)
treec89b8b2068f1139364110b10e8d39c1603695b6a /queries/haskell
parentAdd ninja parser (#2217) (diff)
downloadnvim-treesitter-50fee51d352317aaed28532c5f2f3f5e44fdd7bc.tar
nvim-treesitter-50fee51d352317aaed28532c5f2f3f5e44fdd7bc.tar.gz
nvim-treesitter-50fee51d352317aaed28532c5f2f3f5e44fdd7bc.tar.bz2
nvim-treesitter-50fee51d352317aaed28532c5f2f3f5e44fdd7bc.tar.lz
nvim-treesitter-50fee51d352317aaed28532c5f2f3f5e44fdd7bc.tar.xz
nvim-treesitter-50fee51d352317aaed28532c5f2f3f5e44fdd7bc.tar.zst
nvim-treesitter-50fee51d352317aaed28532c5f2f3f5e44fdd7bc.zip
Improve Haskell highlighting
Diffstat (limited to 'queries/haskell')
-rw-r--r--queries/haskell/highlights.scm23
1 files changed, 14 insertions, 9 deletions
diff --git a/queries/haskell/highlights.scm b/queries/haskell/highlights.scm
index a0eecf977..4785b0deb 100644
--- a/queries/haskell/highlights.scm
+++ b/queries/haskell/highlights.scm
@@ -11,6 +11,7 @@
(comment) @comment
+
;; ----------------------------------------------------------------------------
;; Punctuation
@@ -72,10 +73,7 @@
"@"
] @operator
-(qualified_module (module) @constructor)
-(qualified_type (module) @namespace)
-(qualified_variable (module) @namespace)
-(import (module) @namespace)
+(module) @namespace
[
(where)
@@ -96,27 +94,34 @@
"do"
"mdo"
"rec"
+ "infix"
+ "infixl"
+ "infixr"
] @keyword
;; ----------------------------------------------------------------------------
;; Functions and variables
-(signature name: (variable) @type)
-(function name: (variable) @function)
-
(variable) @variable
-"_" @punctuation.special
+(pat_wildcard) @variable
+
+(signature name: (variable) @type)
+(function
+ name: (variable) @function
+ patterns: (patterns))
(exp_infix (variable) @operator) ; consider infix functions as operators
-("@" @namespace) ; "as" pattern operator, e.g. x@Constructor
+(exp_apply . (exp_name (variable) @function))
+(exp_apply . (exp_name (qualified_variable (variable) @function)))
;; ----------------------------------------------------------------------------
;; Types
(type) @type
+(type_variable) @type
(constructor) @constructor