aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/odin/indents.scm
blob: 9c863297838fc3b3ea78c04ed30515247a7f4f7a (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
[
  (block)
  (enum_declaration)
  (union_declaration)
  (bit_field_declaration)
  (struct_declaration)
  (struct)
  (parameters)
  (tuple_type)
  (call_expression)
  (switch_case)
] @indent.begin

; hello(
((identifier)
  .
  (ERROR
    "(" @indent.begin))

[
  ")"
  "]"
] @indent.branch @indent.end

; Have to do all closing brackets separately because the one for switch statements shouldn't end.
(block
  "}" @indent.branch @indent.end)

(enum_declaration
  "}" @indent.branch @indent.end)

(union_declaration
  "}" @indent.branch @indent.end)

(struct_declaration
  "}" @indent.branch @indent.end)

(struct
  "}" @indent.branch @indent.end)

[
  (comment)
  (block_comment)
  (string)
  (ERROR)
] @indent.auto