aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queries/unison/highlights.scm72
-rw-r--r--runtime/queries/unison/injections.scm1
2 files changed, 73 insertions, 0 deletions
diff --git a/runtime/queries/unison/highlights.scm b/runtime/queries/unison/highlights.scm
new file mode 100644
index 00000000..8ec2b6ff
--- /dev/null
+++ b/runtime/queries/unison/highlights.scm
@@ -0,0 +1,72 @@
+;; Primitives
+(comment) @comment
+(nat) @constant.numeric
+(unit) @constant.builtin
+(literal_char) @constant.character
+(literal_text) @string
+(literal_boolean) @constant.builtin.boolean
+
+;; Keywords
+[
+ (kw_forall)
+ (unique_kw)
+ (type_kw)
+ (kw_equals)
+ (do)
+] @keyword
+
+(kw_let) @keyword.function
+(type_kw) @keyword.storage.type
+(unique) @keyword.storage.modifier
+("use") @keyword.control.import
+
+
+[
+ (type_constructor)
+] @constructor
+
+[
+ (operator)
+ (pipe)
+ (arrow_symbol)
+ (">")
+ (or)
+ (bang)
+] @operator
+
+[
+ "if"
+ "else"
+ "then"
+ (match)
+ (with)
+ (cases)
+] @keyword.control.conditional
+
+(blank_pattern) @variable.builtin
+
+;; Types
+(record_field name: (wordy_id) @variable.other.member type: (wordy_id) @type)
+[
+ (type_name)
+ (type_signature)
+ (effect)
+] @type
+
+(term_definition) @variable
+
+;; Punctuation
+[
+ (type_signature_colon)
+ ":"
+] @punctuation.delimiter
+
+[
+ "("
+ ")"
+ "{"
+ "}"
+ "["
+ "]"
+] @punctuation.bracket
+
diff --git a/runtime/queries/unison/injections.scm b/runtime/queries/unison/injections.scm
new file mode 100644
index 00000000..4f0cc44c
--- /dev/null
+++ b/runtime/queries/unison/injections.scm
@@ -0,0 +1 @@
+((doc_block) @injection.content (#set! injection.language "markdown"))