Issue 57294
Summary clang-format indents java new array _expression_ poorly
Labels clang-format, new issue
Assignees
Reporter zmodem
    Consider:

```
$ cat | clang-format -style=chromium --assume-filename=x.java
class C {
  public void f() {
    waitForKeyboardStates(3, 1, 5, new Integer[] {TextInputType.NUMBER, TextInputType.NUMBER, TextInputType.NUMBER, TextInputType.TEXT});
  } 
}
```

it prints:

```
class C {
    public void f() {
        waitForKeyboardStates(3, 1, 5,
                new Integer[] {TextInputType.NUMBER, TextInputType.NUMBER, TextInputType.NUMBER,
                        TextInputType.TEXT});
    }
}
```

It would have been nicer to align the TextInputType values, as it would do if we drop the `--assume-filename` argument:

```
class C {
 public
  void f() {
    waitForKeyboardStates(
        3, 1, 5,
        new Integer[]{TextInputType.NUMBER, TextInputType.NUMBER,
                      TextInputType.NUMBER, TextInputType.TEXT});
  }
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to