jhipster / prettier-java

Prettier Java Plugin
http://www.jhipster.tech/prettier-java/
Apache License 2.0
1.08k stars 103 forks source link

Use different indentation level for `throws` #583

Closed jsh9 closed 2 months ago

jsh9 commented 1 year ago

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.

jhaber commented 1 year ago

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

jtkiesel commented 2 months ago

Closing as a duplicate of #429.