mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 11:36:54 -04:00
feat: add haskell highlights
This commit is contained in:
parent
5e500cbc88
commit
684b74bea1
1 changed files with 91 additions and 0 deletions
91
queries/haskell/highlights.scm
Normal file
91
queries/haskell/highlights.scm
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue