Skip to content

Commit 021a51d

Browse files
authored
Fix auto-indentation (#31)
I swear auto-indentation worked at some point, the valid captures for `indents.scm` must have changed recently.
1 parent 6d9843a commit 021a51d

File tree

1 file changed

+3
-40
lines changed

1 file changed

+3
-40
lines changed

languages/java/indents.scm

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,3 @@
1-
; format-ignore
2-
[
3-
; ... refers to the portion that this indent query will have effects on
4-
(class_body) ; { ... } of `class X`
5-
(enum_body) ; { ... } of `enum X`
6-
(interface_body) ; { ... } of `interface X`
7-
(constructor_body) ; { `modifier` X() {...} } inside `class X`
8-
(annotation_type_body) ; { ... } of `@interface X`
9-
(block) ; { ... } that's not mentioned in this scope
10-
(switch_block) ; { ... } in `switch X`
11-
(array_initializer) ; [1, 2]
12-
(argument_list) ; foo(...)
13-
(formal_parameters) ; method foo(...)
14-
(annotation_argument_list) ; @Annotation(...)
15-
(element_value_array_initializer) ; { a, b } inside @Annotation()
16-
] @indent.begin
17-
18-
(expression_statement
19-
(method_invocation) @indent.begin)
20-
21-
[
22-
"("
23-
")"
24-
"{"
25-
"}"
26-
"["
27-
"]"
28-
] @indent.branch
29-
30-
(annotation_argument_list
31-
")" @indent.end) ; This should be a special cased as `()` here doesn't have ending `;`
32-
33-
"}" @indent.end
34-
35-
(line_comment) @indent.ignore
36-
37-
[
38-
(ERROR)
39-
(block_comment)
40-
] @indent.auto
1+
(_ "{" "}" @end) @indent
2+
(_ "[" "]" @end) @indent
3+
(_ "(" ")" @end) @indent

0 commit comments

Comments
 (0)