helix/runtime/queries/koto/indents.scm
2024-12-20 09:56:13 -06:00

61 lines
712 B
Scheme

[
(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