aboutsummaryrefslogtreecommitdiff
path: root/helix-22.03-x86_64-windows/runtime/queries/haskell
diff options
context:
space:
mode:
authorIndrajith K L2022-12-03 17:00:20 +0530
committerIndrajith K L2022-12-03 17:00:20 +0530
commitf5c4671bfbad96bf346bd7e9a21fc4317b4959df (patch)
tree2764fc62da58f2ba8da7ed341643fc359873142f /helix-22.03-x86_64-windows/runtime/queries/haskell
downloadcli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.tar.gz
cli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.tar.bz2
cli-tools-windows-f5c4671bfbad96bf346bd7e9a21fc4317b4959df.zip
Adds most of the toolsHEADmaster
Diffstat (limited to 'helix-22.03-x86_64-windows/runtime/queries/haskell')
-rw-r--r--helix-22.03-x86_64-windows/runtime/queries/haskell/highlights.scm125
-rw-r--r--helix-22.03-x86_64-windows/runtime/queries/haskell/injections.scm2
-rw-r--r--helix-22.03-x86_64-windows/runtime/queries/haskell/locals.scm4
3 files changed, 131 insertions, 0 deletions
diff --git a/helix-22.03-x86_64-windows/runtime/queries/haskell/highlights.scm b/helix-22.03-x86_64-windows/runtime/queries/haskell/highlights.scm
new file mode 100644
index 0000000..5009f3b
--- /dev/null
+++ b/helix-22.03-x86_64-windows/runtime/queries/haskell/highlights.scm
@@ -0,0 +1,125 @@
+;; ----------------------------------------------------------------------------
+;; Literals and comments
+
+(integer) @constant.numeric.integer
+(exp_negation) @constant.numeric.integer
+(exp_literal (float)) @constant.numeric.float
+(char) @constant.character
+(string) @string
+
+(con_unit) @constant.builtin ; unit, as in ()
+
+(comment) @comment
+
+
+;; ----------------------------------------------------------------------------
+;; Punctuation
+
+[
+ "("
+ ")"
+ "{"
+ "}"
+ "["
+ "]"
+] @punctuation.bracket
+
+[
+ (comma)
+ ";"
+] @punctuation.delimiter
+
+
+;; ----------------------------------------------------------------------------
+;; Keywords, operators, includes
+
+(pragma) @constant.macro
+
+[
+ "if"
+ "then"
+ "else"
+ "case"
+ "of"
+] @keyword.control.conditional
+
+[
+ "import"
+ "qualified"
+ "module"
+] @keyword.control.import
+
+[
+ (operator)
+ (constructor_operator)
+ (type_operator)
+ (tycon_arrow)
+ (qualified_module) ; grabs the `.` (dot), ex: import System.IO
+ (all_names)
+ (wildcard)
+ "="
+ "|"
+ "::"
+ "=>"
+ "->"
+ "<-"
+ "\\"
+ "`"
+ "@"
+] @operator
+
+(qualified_module (module) @constructor)
+(qualified_type (module) @namespace)
+(qualified_variable (module) @namespace)
+(import (module) @namespace)
+
+[
+ (where)
+ "let"
+ "in"
+ "class"
+ "instance"
+ "data"
+ "newtype"
+ "family"
+ "type"
+ "as"
+ "hiding"
+ "deriving"
+ "via"
+ "stock"
+ "anyclass"
+ "do"
+ "mdo"
+ "rec"
+ "forall"
+ "∀"
+ "infix"
+ "infixl"
+ "infixr"
+] @keyword
+
+
+;; ----------------------------------------------------------------------------
+;; Functions and variables
+
+(signature name: (variable) @type)
+(function name: (variable) @function)
+
+(variable) @variable
+"_" @variable.builtin
+
+(exp_infix (variable) @operator) ; consider infix functions as operators
+
+("@" @namespace) ; "as" pattern operator, e.g. x@Constructor
+
+
+;; ----------------------------------------------------------------------------
+;; Types
+
+(type) @type
+
+(constructor) @constructor
+
+; True or False
+((constructor) @_bool (#match? @_bool "(True|False)")) @constant.builtin.boolean
diff --git a/helix-22.03-x86_64-windows/runtime/queries/haskell/injections.scm b/helix-22.03-x86_64-windows/runtime/queries/haskell/injections.scm
new file mode 100644
index 0000000..321c90a
--- /dev/null
+++ b/helix-22.03-x86_64-windows/runtime/queries/haskell/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
diff --git a/helix-22.03-x86_64-windows/runtime/queries/haskell/locals.scm b/helix-22.03-x86_64-windows/runtime/queries/haskell/locals.scm
new file mode 100644
index 0000000..ad67fe4
--- /dev/null
+++ b/helix-22.03-x86_64-windows/runtime/queries/haskell/locals.scm
@@ -0,0 +1,4 @@
+(signature name: (variable)) @local.definition
+(function name: (variable)) @local.definition
+(pat_name (variable)) @local.definition
+(exp_name (variable)) @local.reference