Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/koto/indents.scm')
-rw-r--r--runtime/queries/koto/indents.scm61
1 files changed, 61 insertions, 0 deletions
diff --git a/runtime/queries/koto/indents.scm b/runtime/queries/koto/indents.scm
new file mode 100644
index 00000000..0eab2b50
--- /dev/null
+++ b/runtime/queries/koto/indents.scm
@@ -0,0 +1,61 @@
+[
+ (list)
+ (map)
+ (tuple)
+] @indent
+
+[
+ (for)
+ (else_if)
+ (else)
+ (match)
+ (switch)
+ (until)
+ (while)
+] @indent @extend
+
+(assign
+ "=" @indent @extend
+ !rhs
+)
+(assign
+ "=" @indent @extend
+ rhs: (_) @anchor
+ (#not-same-line? @indent @anchor)
+)
+
+(if
+ condition: (_) @indent @extend
+ !then
+)
+(if
+ condition: (_) @indent @extend
+ then: (_) @anchor
+ (#not-same-line? @indent @anchor)
+)
+
+(function
+ (args) @indent @extend
+ !body
+)
+(function
+ (args) @indent @extend
+ body: (_) @anchor
+ (#not-same-line? @indent @anchor)
+)
+
+(match_arm
+ "then" @indent @extend
+ !then
+)
+(match_arm
+ "then" @indent @extend
+ then: (_) @anchor
+ (#not-same-line? @indent @anchor)
+)
+
+[
+ "}"
+ "]"
+ ")"
+] @outdent