Is there any way to customize the indentation/format rules? The following screenshots should describe what I want to happen


I want it to not mess up my custom formatting and simply fix indentation errors. Is this possible?
IntelliJ is able to format code into my pre-format form as well.
vscode-java doesn't expose formatting options of the underlying Eclipse JDT formatter yet.
You currently have 2 options:
java.format.enabled to false in VS Code's preferences.settings/org.eclipse.jdt.core.prefs. The 2nd solution is rather tedious, so the best way to do it 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 :

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.
Thanks for the work around! Any plans on integrating this type of customization?
It's in our backlog: #2
Will keep the discussion open in #2. Closing this one as duplicate (kinda)
@fbricon The 2nd solution does not works for me.
Below is my code. I can't get 4 blank line before methods. Now I have only 1 blank line, as same as the default setting.

I don't know if I did something wrong or this is just a bug.
OS: macOS 10.13
VSCode: 1.17.2
Language Support for Java(TM) by Red Hat: 0.12.0
@ocavue the solution works for actual projects. What you have is a folder with a java project and a .classpath file. So what defines what an actual project is? At the root of your folder you need to have either:
pom.xml, build.gradle, .project and .classpath files.I strongly suggest you go with making either a Maven or a Gradle project. But if you find that too daunting, a simpler alternative is to use Eclipse to create a new Java project.
Then add your java class to your project source folder.
Once you have your project structure created, you can close your IDE to open the folder in VS Code. Changing org.eclipse.jdt.core.formatter.blank_lines_before_method=4 in .settings/org.eclipse.jdt.core.prefs should now work.

@fbricon Sorry for posting a stupid question. I know little about java and your detailed answer is really helpful. Thanks.
Most helpful comment
vscode-java doesn't expose formatting options of the underlying Eclipse JDT formatter yet.
You currently have 2 options:
java.format.enabledto false in VS Code's preferences.settings/org.eclipse.jdt.core.prefs.The 2nd solution is rather tedious, so the best way to do it 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>Formatterand create a new formatting profile :Once you save it,
.settings/org.eclipse.jdt.core.prefswill 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.