aboutsummaryrefslogtreecommitdiffstats
path: root/queries
diff options
context:
space:
mode:
Diffstat (limited to 'queries')
-rw-r--r--queries/haskell/injections.scm7
-rw-r--r--queries/haskell_persistent/folds.scm3
-rw-r--r--queries/haskell_persistent/highlights.scm38
3 files changed, 48 insertions, 0 deletions
diff --git a/queries/haskell/injections.scm b/queries/haskell/injections.scm
index 206248f6e..f210566c4 100644
--- a/queries/haskell/injections.scm
+++ b/queries/haskell/injections.scm
@@ -76,3 +76,10 @@
(#eq? @_name "sql")
((quasiquote_body) @sql)
)
+
+; persistent
+(quasiquote
+ (quoter) @_name
+ (#any-of? @_name "persistUpperCase" "persistLowerCase" "persistWith")
+ ((quasiquote_body) @haskell_persistent)
+)
diff --git a/queries/haskell_persistent/folds.scm b/queries/haskell_persistent/folds.scm
new file mode 100644
index 000000000..2bdffd177
--- /dev/null
+++ b/queries/haskell_persistent/folds.scm
@@ -0,0 +1,3 @@
+[
+ (entity_definition)
+] @fold
diff --git a/queries/haskell_persistent/highlights.scm b/queries/haskell_persistent/highlights.scm
new file mode 100644
index 000000000..afb32f11d
--- /dev/null
+++ b/queries/haskell_persistent/highlights.scm
@@ -0,0 +1,38 @@
+;; ----------------------------------------------------------------------------
+;; Literals and comments
+
+(integer) @number
+(float) @float
+(char) @character
+(string) @string
+(attribute_name) @attribute
+(attribute_exclamation_mark) @attribute
+
+(con_unit) @symbol ; unit, as in ()
+
+(comment) @comment @spell
+
+;; ----------------------------------------------------------------------------
+;; Keywords, operators, includes
+
+[
+ "Id"
+ "Primary"
+ "Foreign"
+ "deriving"
+] @keyword
+
+"=" @operator
+
+
+;; ----------------------------------------------------------------------------
+;; Functions and variables
+
+(variable) @variable
+
+;; ----------------------------------------------------------------------------
+;; Types
+
+(type) @type
+
+(constructor) @constructor