Format your java files using Google Java Format program which follows Google Java Style (or AOSP).
This extension is available on:
- Visual Studio Marketplace for VS Code
- OpenVSX Registry for VSCodium, Cursor, and other VS Code compatible editors
- GitHub Releases as
.vsixfiles for manual installation
This extension contributes the following settings:
java.format.settings.google.executable: Not Recommended. Specifies url or file path to Google Java Format jar executable. Overridesjava.format.settings.google.version.java.format.settings.google.version: Recommended. Specifies version to be used of Google Java Format executable in format{major}.{minor}.{patch}. Default:latest.java.format.settings.google.mode: Specifies the runtime mode of Google Java Format. Used withjava.format.settings.google.version. Default:native-binary, alternative:jar-file.java.format.settings.google.extra: Extra CLI arguments to pass to Google Java Format.
Please refer Google Java Format repository for available versions and CLI arguments.
This extension contributes the following commands:
Google Java Format For VS Code: Clear Cache: Clear cache of Google Java Format executable downloads by the extension.Google Java Format For VS Code: Reload Executable: Reload the Google Java Format executable using the current configuration.
To debug this extension and see how exactly it invokes the formatter, use Developer: Set Log Level... to enable Debug for this extension, and then open the Output tab and select this extension.
Enjoy!