aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/ponylang/indents.scm
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/queries/ponylang/indents.scm')
-rw-r--r--runtime/queries/ponylang/indents.scm32
1 files changed, 32 insertions, 0 deletions
diff --git a/runtime/queries/ponylang/indents.scm b/runtime/queries/ponylang/indents.scm
new file mode 100644
index 00000000..ef9c8203
--- /dev/null
+++ b/runtime/queries/ponylang/indents.scm
@@ -0,0 +1,32 @@
+; queries for helix to do automatic indentation upon hitting enter
+; TODO: needs more work, cover more cases
+[
+ (entity)
+ (method)
+ (behavior)
+ (constructor)
+ (block)
+ (tuple)
+ (grouped)
+] @indent
+(match_case body: (block) @indent)
+; ffi_call and call
+(_ arguments: (_) @indent)
+(assignment right: (_) @indent
+ (#set! "scope" "all")
+)
+
+[
+ (params)
+ (object)
+ ("if")
+] @extend
+(lambda params: (_) @extend)
+
+[
+ "end"
+ "}"
+ "]"
+ ")"
+ "|"
+] @outdent