aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBanst2022-07-31 12:04:57 +0000
committerGitHub2022-07-31 12:04:57 +0000
commit7e066814133c62ab76a2da8dd021b6001f3b70f9 (patch)
treeffe622a185032c1d3d3ea39f1d4c5f9da51c4c77 /runtime
parent110eb73045b9a61654a6805cc006b934422fd82f (diff)
feat: add cue support (#3262)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queries/cue/highlights.scm110
1 files changed, 110 insertions, 0 deletions
diff --git a/runtime/queries/cue/highlights.scm b/runtime/queries/cue/highlights.scm
new file mode 100644
index 00000000..aef016e8
--- /dev/null
+++ b/runtime/queries/cue/highlights.scm
@@ -0,0 +1,110 @@
+(package_clause "package" @keyword.control.import)
+
+(package_identifier) @variable
+
+(import_declaration "import" @keyword.control.import)
+
+[
+ "!"
+ "*"
+ "|"
+ "&"
+ "||"
+ "&&"
+ "=="
+ "!="
+ "<"
+ "<="
+ ">"
+ ">="
+ "=~"
+ "!~"
+ "+"
+ "-"
+ "*"
+ "/"
+] @operator
+
+(unary_expression "*" @operator.default)
+
+(unary_expression "=~" @operator.regexp)
+
+(unary_expression "!~" @operator.regexp)
+
+(binary_expression _ "&" @operator.unify _)
+
+(binary_expression _ "|" @operator.disjunct _)
+
+(builtin) @function.builtin
+
+(qualified_identifier) @function.builtin
+
+(let_clause "let" @keyword.storage.type)
+
+(for_clause "for" @keyword.control.repeat)
+(for_clause "in" @keyword.control.repeat)
+
+(guard_clause "if" @keyword.control.conditional)
+
+(comment) @comment
+
+[
+ (string_type)
+ (simple_string_lit)
+ (multiline_string_lit)
+ (bytes_type)
+ (simple_bytes_lit)
+ (multiline_bytes_lit)
+] @string
+
+[
+ (number_type)
+ (int_lit)
+ (int_type)
+ (uint_type)
+] @constant.numeric.integer
+
+[
+ (float_lit)
+ (float_type)
+] @constant.numeric.float
+
+[
+ (bool_type)
+ (true)
+ (false)
+] @constant.builtin.boolean
+
+(null) @constant.builtin
+
+(ellipsis) @punctuation.bracket
+
+[
+ ","
+ ":"
+] @punctuation.delimiter
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+(interpolation "\\(" @punctuation.bracket (_) ")" @punctuation.bracket) @variable.other.member
+
+(field (label (identifier) @variable.other.member))
+
+(
+ (identifier) @keyword.storage.type
+ (#match? @keyword.storage.type "^#")
+)
+
+(field (label alias: (identifier) @label))
+
+(let_clause left: (identifier) @label)
+
+
+(attribute (identifier) @tag)