aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/nickel
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/queries/nickel')
-rw-r--r--runtime/queries/nickel/highlights.scm74
-rw-r--r--runtime/queries/nickel/indents.scm13
-rw-r--r--runtime/queries/nickel/injections.scm2
3 files changed, 89 insertions, 0 deletions
diff --git a/runtime/queries/nickel/highlights.scm b/runtime/queries/nickel/highlights.scm
new file mode 100644
index 000000000..07673d797
--- /dev/null
+++ b/runtime/queries/nickel/highlights.scm
@@ -0,0 +1,74 @@
+(comment) @comment @spell
+
+[
+ "forall"
+ "in"
+ "let"
+ "default"
+ "doc"
+ "rec"
+] @keyword
+
+"fun" @keyword.function
+
+"import" @keyword.import
+
+[
+ "if"
+ "then"
+ "else"
+] @keyword.conditional
+
+"match" @keyword.conditional
+
+(types) @type
+
+"Array" @type.builtin
+
+; BUILTIN Constants
+(bool) @boolean
+
+"null" @constant.builtin
+
+(num_literal) @number
+
+(infix_op) @operator
+
+(type_atom) @type
+
+(enum_tag) @variable
+
+(chunk_literal_single) @string
+
+(chunk_literal_multi) @string
+
+(str_esc_char) @string.escape
+
+[
+ "{"
+ "}"
+ "("
+ ")"
+ "[|"
+ "|]"
+] @punctuation.bracket
+
+(multstr_start) @punctuation.bracket
+
+(multstr_end) @punctuation.bracket
+
+(interpolation_start) @punctuation.bracket
+
+(interpolation_end) @punctuation.bracket
+
+(record_field) @variable.member
+
+(builtin) @function.builtin
+
+(fun_expr
+ pats: (pattern_fun
+ (ident) @variable.parameter))
+
+(applicative
+ t1: (applicative
+ (record_operand) @function))
diff --git a/runtime/queries/nickel/indents.scm b/runtime/queries/nickel/indents.scm
new file mode 100644
index 000000000..8c6f740d9
--- /dev/null
+++ b/runtime/queries/nickel/indents.scm
@@ -0,0 +1,13 @@
+[
+ (atom
+ (uni_record)) ; for {...}
+ (atom
+ terms: (term)) ; for [...]
+] @indent.begin
+
+[
+ "]"
+ "}"
+] @indent.end @indent.branch
+
+(comment) @indent.auto
diff --git a/runtime/queries/nickel/injections.scm b/runtime/queries/nickel/injections.scm
new file mode 100644
index 000000000..2f0e58eb6
--- /dev/null
+++ b/runtime/queries/nickel/injections.scm
@@ -0,0 +1,2 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))