Download the formatter and run it with: To reformat changed lines in a specific patch, use google-java-format-diff.py. Note: There is no configurability as to the formatter's algorithm for formatting.
Open a Java file in Visual Studio Code Use the Format Document command Enjoy your beautifully formatted Java code! You can also set it as your default Java formatter in Visual Studio Code settings: ...