aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/ponylang/indents.scm
blob: ef9c82036572ff763d77ff145725fdfe127254ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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