Debian Codegraph @

runtime/queries/java/indents.scm

raw symbols SCIP
1 [
2 (class_body)
3 (enum_body)
4 (interface_body)
5 (constructor_body)
6 (annotation_type_body)
7 (module_body)
8 (block)
9 (switch_block)
10 ; statements after a `case`/`default` label (the group also holds the label,
11 ; so the default tail scope indents only the body lines, not the label)
12 (switch_block_statement_group)
13 (array_initializer)
14 (argument_list)
15 (formal_parameters)
16 (annotation_argument_list)
17 (element_value_array_initializer)
18 ] @indent
19
20 [
21 "}"
22 ")"
23 "]"
24 ] @outdent
25
26 ; Single statement after if/while/for without braces. Capture the body child
27 ; naturally; on a typed newline the engine descends into it.
28 (if_statement
29 consequence: (_) @indent
30 (#not-kind-eq? @indent "block")
31 (#set! "scope" "header"))
32 ; Braceless `else` body (the body is the alternative field). Skip `else if`
33 ; (alternative is an if_statement) and braced bodies.
34 (if_statement
35 alternative: (_) @indent
36 (#not-kind-eq? @indent "block")
37 (#not-kind-eq? @indent "if_statement")
38 (#set! "scope" "header"))
39 (while_statement
40 body: (_) @indent
41 (#not-kind-eq? @indent "block")
42 (#set! "scope" "header"))
43 (for_statement
44 body: (_) @indent
45 (#not-kind-eq? @indent "block")
46 (#set! "scope" "header"))
47
48 (string_literal) @opaque