prettier-java
prettier-java copied to clipboard
Continuation Indent
Prettier-Java ^0.8.0
# Options (if any):
--print-width 80
Input:
// code snippet
public class Test {
public void testMethod(final String param1, final String param2) throws Exception {
throw new Exception("blah");
}
}
Output:
Note that
throws
andthrow
appear at the same indentation.
// code snippet
public class Test {
public void testMethod(final String param1, final String param2)
throws Exception {
throw new Exception("blah");
}
}
Expected behavior:
When throws
is wrapped, it seems like it should be more clearly separated from code inside the method.
One option is to use one additional indentation any time a line is wrapped, but open to alternatives:
public class Test {
public void testMethod(final String param1, final String param2)
throws Exception {
throw new Exception("blah");
}
}
Some related discussion: https://github.com/jhipster/prettier-java/pull/384#discussion_r410712022