aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queries/haskell-persistent/folds.scm3
-rw-r--r--runtime/queries/haskell-persistent/highlights.scm37
-rw-r--r--runtime/queries/haskell-persistent/locals.scm1
-rw-r--r--runtime/queries/haskell/injections.scm8
4 files changed, 49 insertions, 0 deletions
diff --git a/runtime/queries/haskell-persistent/folds.scm b/runtime/queries/haskell-persistent/folds.scm
new file mode 100644
index 00000000..ac04ad4a
--- /dev/null
+++ b/runtime/queries/haskell-persistent/folds.scm
@@ -0,0 +1,3 @@
+[
+ (entity_definition)
+] @fold
diff --git a/runtime/queries/haskell-persistent/highlights.scm b/runtime/queries/haskell-persistent/highlights.scm
new file mode 100644
index 00000000..d6358578
--- /dev/null
+++ b/runtime/queries/haskell-persistent/highlights.scm
@@ -0,0 +1,37 @@
+;; ----------------------------------------------------------------------------
+;; Literals and comments
+
+(integer) @constant.numeric.integer
+(float) @constant.numeric.float
+(char) @constant.character
+(string) @string
+(attribute_name) @attribute
+(attribute_exclamation_mark) @attribute
+
+(con_unit) @constant.builtin ; unit, as in ()
+
+(comment) @comment
+
+;; ----------------------------------------------------------------------------
+;; Keywords, operators, includes
+
+[
+ "Id"
+ "Primary"
+ "Foreign"
+ "deriving"
+] @keyword
+
+"=" @operator
+
+;; ----------------------------------------------------------------------------
+;; Functions and variables
+
+(variable) @variable
+
+;; ----------------------------------------------------------------------------
+;; Types
+
+(type) @type
+
+(constructor) @constructor
diff --git a/runtime/queries/haskell-persistent/locals.scm b/runtime/queries/haskell-persistent/locals.scm
new file mode 100644
index 00000000..3ffb01a1
--- /dev/null
+++ b/runtime/queries/haskell-persistent/locals.scm
@@ -0,0 +1 @@
+(fields (variable)) @local.definition
diff --git a/runtime/queries/haskell/injections.scm b/runtime/queries/haskell/injections.scm
index 788b8b8c..5ee3478b 100644
--- a/runtime/queries/haskell/injections.scm
+++ b/runtime/queries/haskell/injections.scm
@@ -2,5 +2,13 @@
(#set! injection.language "comment"))
(quasiquote
+ (quoter) @_quoter
+ ((quasiquote_body) @injection.content
+ (#match? @_quoter "(persistWith|persistLowerCase|persistUpperCase)")
+ (#set! injection.language "haskell-persistent")
+ )
+)
+
+(quasiquote
(quoter) @injection.language
(quasiquote_body) @injection.content)