aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/spicedb
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/queries/spicedb')
-rw-r--r--runtime/queries/spicedb/highlights.scm47
-rw-r--r--runtime/queries/spicedb/injections.scm5
-rw-r--r--runtime/queries/spicedb/tags.scm4
3 files changed, 56 insertions, 0 deletions
diff --git a/runtime/queries/spicedb/highlights.scm b/runtime/queries/spicedb/highlights.scm
new file mode 100644
index 00000000..63c93955
--- /dev/null
+++ b/runtime/queries/spicedb/highlights.scm
@@ -0,0 +1,47 @@
+; highlights.scm
+
+[
+ "definition"
+ "caveat"
+ "permission"
+ "relation"
+ "nil"
+] @keyword
+
+[
+ ","
+ ":"
+] @punctuation.delimiter
+
+[
+ "("
+ ")"
+ "{"
+ "}"
+] @punctuation.bracket
+
+[
+ "|"
+ "+"
+ "-"
+ "&"
+ "#"
+ "->"
+ "="
+] @operator
+("with") @keyword.operator
+
+[
+ "nil"
+ "*"
+] @constant.builtin
+
+(comment) @comment
+(type_identifier) @type
+(cel_type_identifier) @type
+(cel_variable_identifier) @variable.parameter
+(field_identifier) @variable.other.member
+[
+ (func_identifier)
+ (method_identifier)
+] @function.method
diff --git a/runtime/queries/spicedb/injections.scm b/runtime/queries/spicedb/injections.scm
new file mode 100644
index 00000000..f8cafc9d
--- /dev/null
+++ b/runtime/queries/spicedb/injections.scm
@@ -0,0 +1,5 @@
+((comment) @injection.content
+ (#set! injection.language "comment"))
+
+((caveat_expr) @injection.content
+ (#set! injection.language "cel"))
diff --git a/runtime/queries/spicedb/tags.scm b/runtime/queries/spicedb/tags.scm
new file mode 100644
index 00000000..a8fe932b
--- /dev/null
+++ b/runtime/queries/spicedb/tags.scm
@@ -0,0 +1,4 @@
+(object_definition
+ name: (type_identifier) @name) @definition.type
+
+(type_identifier) @name @reference.type