prettier-java icon indicating copy to clipboard operation
prettier-java copied to clipboard

Use different indentation level for `throws`

Open jsh9 opened this issue 1 year ago • 1 comments

I tried Prettier-java today and saw this formatting result:

public void myMethodWithLongName(final boolean myArg1, ...)
    throws IOException {
    final String myVariable = "123";
    ...

This makes the throws line and the 1st line of the method body visually indistinguishable. Is it possible to change this behavior?

I think a potential solution would be: to allow a different indentation level (such as 8) for line break indentations.

jsh9 avatar Jun 21 '23 04:06 jsh9

I believe this is referred to as a "continuation" indent. Some related discussion: https://github.com/jhipster/prettier-java/issues/429 https://github.com/jhipster/prettier-java/pull/384#discussion_r410712022

jhaber avatar Jul 11 '23 13:07 jhaber

Closing as a duplicate of #429.

jtkiesel avatar Jul 14 '24 04:07 jtkiesel