aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorelianiva <dicha.arkana03@gmail.com>2021-04-21 16:05:06 +0700
committerStephan Seitz <stephan.lauf@yahoo.de>2021-06-26 12:10:52 +0200
commit684b74bea1dac1a7fd067e83dc5a8a40f5a37d55 (patch)
treed98cb4999a68608e0f3410d492380c1c22ebb704
parentUpdate lockfile.json (diff)
downloadnvim-treesitter-684b74bea1dac1a7fd067e83dc5a8a40f5a37d55.tar
nvim-treesitter-684b74bea1dac1a7fd067e83dc5a8a40f5a37d55.tar.gz
nvim-treesitter-684b74bea1dac1a7fd067e83dc5a8a40f5a37d55.tar.bz2
nvim-treesitter-684b74bea1dac1a7fd067e83dc5a8a40f5a37d55.tar.lz
nvim-treesitter-684b74bea1dac1a7fd067e83dc5a8a40f5a37d55.tar.xz
nvim-treesitter-684b74bea1dac1a7fd067e83dc5a8a40f5a37d55.tar.zst
nvim-treesitter-684b74bea1dac1a7fd067e83dc5a8a40f5a37d55.zip
feat: add haskell highlights
-rw-r--r--queries/haskell/highlights.scm91
1 files changed, 91 insertions, 0 deletions
diff --git a/queries/haskell/highlights.scm b/queries/haskell/highlights.scm
new file mode 100644
index 000000000..d999cb8ec
--- /dev/null
+++ b/queries/haskell/highlights.scm
@@ -0,0 +1,91 @@
+(integer) @number
+(exp_literal (float)) @float
+
+(char) @character
+
+(string) @string
+
+(variable) @variable
+
+(con_unit) @symbol
+
+(comment) @comment
+
+(function name: (variable) @function)
+
+[
+ "forall"
+ "∀"
+] @repeat
+
+(pragma) @constant.macro
+
+[
+ "if"
+ "then"
+ "else"
+] @conditional
+
+[
+ (constructor)
+ (module)
+] @constructor
+
+;; True or False
+((constructor) @_bool (#match? @_bool "(True|False)")) @boolean
+
+(signature name: (variable) @type)
+(constraint class: (class_name (type)) @type)
+(class (class_head class: (class_name (type)) @type))
+(instance (instance_head class: (class_name (type)) @type))
+
+[
+ (type)
+] @type
+
+[
+ (qualified_module) ;; grabs the `.` (dot), ex: import System.IO
+ (tycon_arrow)
+ (operator)
+ (constructor_operator)
+ "::"
+] @operator
+
+[
+ "import"
+ "module"
+] @include
+
+[
+ (where)
+ "let"
+ "in"
+ "class"
+ "instance"
+ "data"
+ "newtype"
+ "family"
+ "type"
+ "qualified"
+ "as"
+ "deriving"
+ "via"
+ "stock"
+ "anyclass"
+ "do"
+ "mdo"
+ "rec"
+] @keyword
+
+[
+ "("
+ ")"
+ "{"
+ "}"
+ "["
+ "]"
+] @punctuation.bracket
+
+; [
+; ","
+; ] @punctuation.delimiter