helix-mirror/runtime/queries/ponylang/indents.scm
2023-01-10 19:54:19 -06:00

33 lines
461 B
Scheme

; 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