Fixed incorrect Java indentation for method chaining

This commit is contained in:
Daniel Woznicki 2022-04-02 10:49:09 -07:00 committed by Stephan Seitz
parent 2472e47e15
commit e1f8a8a6f8
3 changed files with 9 additions and 1 deletions

View file

@ -11,6 +11,8 @@
(formal_parameters)
] @indent
(expression_statement (method_invocation) @indent)
[
"("
")"
@ -22,7 +24,6 @@
[
"}"
")"
] @indent_end
(line_comment) @ignore

View file

@ -0,0 +1,6 @@
public class Foo {
void foo() {
new StringBuilder()
.append("a")
}
}

View file

@ -30,5 +30,6 @@ describe("indent Java:", function()
XFAIL
)
run:new_line("issue_2583.java", { on_line = 4, text = "int x = 1;", indent = 4 })
run:new_line("method_chaining.java", { on_line = 4, text = ".append(\"b\");", indent = 6 })
end)
end)