Reputation: 4555
public MyClass aVeryLongMethod(
String args1, String args2, String args3, String args4, String args2)
throws Exception
{
myMethod();
I have an eclipse style java formatter (on VSCode). What are the indentation settings for the following?
aVeryLongMethod(
Upvotes: 0
Views: 1325
Reputation: 9521
Open Command Palette, there's Java: Open Java Formatter Settings with Preview, where you can customize your formatting style. Turn to the option Wrapping, you can set the code max length.
In my following example, the length to the end of function name is 32, so if i set the max length as 32
, turn back to .java file, right click and choose Format Document
, please see the effect:
Have a try.
Upvotes: 0
Reputation: 12822
On Eclipse, the java formatter can be configured as follows (Java -> Code style -> Formatter -> edit Active Profile). The line width affects the final result I guess. Profile can be exported also.
Upvotes: 0
Reputation: 1468
There is no specified line indentation in Java. That means unline Python, in Java indentations are not syntactically counted. White spaces are ignored by the lexer.
Anyway, it is important to have a better indentation for clean code. You can use the VS Code formatted to format your indentations. If I have such a case, I used to the following syle.
public MyClass aVeryLongMethod(
String args1,
String args2,
String args3,
String args4,
String args2
) throws Exception {
myMethod();
}
Upvotes: 0