aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/ponylang/indents.scm
diff options
context:
space:
mode:
authorMatthias Wahl2023-01-11 01:54:19 +0000
committerGitHub2023-01-11 01:54:19 +0000
commite65f28d41af0b095eb7ff340f20c7d0d4193e287 (patch)
treeed0878fa67a7202980b168bda8ba070ae419a9df /runtime/queries/ponylang/indents.scm
parent3ca42f7787085ca1c435147da2fcc696a87f6e21 (diff)
Add language support for ponylang (#5416)
See https://www.ponylang.io
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