Skip to content

Formatter settings

Fred Bricon edited this page Jan 26, 2018 · 3 revisions

vscode-java doesn't expose formatting options of the underlying Eclipse JDT formatter yet.

As a workaround, you can define the formatting preferences in your project's .settings/org.eclipse.jdt.core.prefs.

Since this is rather tedious, the best way to edit those preferences is to open your project in Eclipse and set the formatting preferences for your project there.

In Eclipse, right-click on your project, open Properties > Java Code Style > Formatter and create a new formatting profile : screen shot 2017-08-24 at 2 41 36 pm

Once you save it, .settings/org.eclipse.jdt.core.prefs will be updated. This file will need to be copied to all your other projects in the same workspace.

No it's not an ideal solution, but it should be done only once, unless you regularly change your formatter settings.