When I type an if statement on one line
if (root == null) return null
VSCode's formatter is putting a linebreak, turning the above into
if (root == null)
return null;
How do I configure the formatter to leave statements like these on one line? I have gone through all the settings in java-formatter.xml
and can't find one that sounds like it's talking about this.
CodePudding user response:
you can find a setting in java-formatter.xml
:
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line
set it to true and try to re-format your source file.