Debian Codegraph @

runtime/queries/ecma/indents.scm

raw symbols SCIP
1 [
2 (array)
3 (object)
4 (arguments)
5 (formal_parameters)
6
7 (statement_block)
8 (switch_statement)
9 (object_pattern)
10 (class_body)
11 (named_imports)
12
13 (binary_expression)
14 (return_statement)
15 (template_substitution)
16 (export_clause)
17
18 (member_expression)
19 (call_expression)
20 ] @indent
21
22 [
23 (switch_case)
24 (switch_default)
25 ] @indent
26
27 [
28 "}"
29 "]"
30 ")"
31 ] @outdent
32
33 ; Single-statement bodies without braces (if/else/while/for/do). Indent the
34 ; statement node so a newline typed after the header indents — capturing the
35 ; body child alone only reindents existing lines, since the typing-direction
36 ; walk reaches the statement, not its body child. The else-bearing if keeps the
37 ; consequence-child form (scope all) so the `else` line itself isn't indented;
38 ; a braceless else/do body is handled via its own node for the same reason.
39 (if_statement
40 consequence: (_) @_body
41 (#not-kind-eq? @_body "statement_block")
42 !alternative) @indent
43 (if_statement
44 consequence: (_) @indent
45 (#not-kind-eq? @indent "statement_block")
46 alternative: (_)
47 (#set! "scope" "header"))
48 (else_clause
49 (_) @_body
50 (#not-kind-eq? @_body "statement_block")
51 (#not-kind-eq? @_body "if_statement")) @indent
52 (while_statement
53 body: (_) @_body
54 (#not-kind-eq? @_body "statement_block")) @indent
55 (for_statement
56 body: (_) @_body
57 (#not-kind-eq? @_body "statement_block")) @indent
58 (for_in_statement
59 body: (_) @_body
60 (#not-kind-eq? @_body "statement_block")) @indent
61 (do_statement
62 body: (_) @indent
63 (#not-kind-eq? @indent "statement_block")
64 (#set! "scope" "header"))
65
66 ; Template-literal bodies are literal content (between interpolations).
67 (template_string) @opaque