I am looking for a way so that vscode will format my java code such that curly braces are on separate lines. For example…
if(x)
{
dosomething();
}
else
{
dosomethingelse();
}
I’ve tried installing Java prettier format and Language Support for Java Red Hat, and neither of those seem to help.
2
Answers
IDE Eclipse has template for Java code format there on e can change for desired style. Similarly for VS code also it should have template and changing template should give required effect
You can use the
Java: Open Java Formatter Settings with Preview.
command to open the format settings preview window for modification.More detailed settings can be read here.