Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Seamless Prettier For Java 2022New to Visual Studio Code? Get it now.

Seamless Prettier For Java 2022

Hyperproof

|
452 installs
| (0) | Free
VSCode extension enabling *fast* format-on-save for Java sources using prettier=^2.7 and prettier-plugin-java=^1.6.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Java prettier formatter

A VSCode extension enabling fast format-on-save for Java sources using prettier=^2.7 and prettier-plugin-java=^1.6.

Installation

Install via the VS Code marketplace.

Usage

For one time use:-

  • Open the Command Palette (ctrl+shift+p).
  • Select 'Format Document With...' or 'Format Document' if this formatter is the only Java formatter installed.
  • Select 'Java prettier formatter'.

To set as default formatter for Java files:-

  • Open the Command Palette (ctrl+shift+p).
  • Select 'Preferences: Configure Language Specific Settings'.
  • Select 'Java'.
  • Add the following line under the [java] section:
"editor.defaultFormatter": "hyperproof.vscode-ext-prettier-java"

Configuration

Place a .prettierrc in your workspace. (Or alternatively an appropriate .editorconfig.) Changes require restart to take effect.

Summary of deploy process

  • npm i -g vsce
  • vsce package
  • vsce publish

Acknowledgments

This plugin is based on mwpb.java-prettier-formatter. We updated the underlying tools, updated all dependencies to their latest compatible versions, updated the VSCode plugin module, and converted the project to TypeScript. Big thanks to them and and the projects below!

  • Prettier - Formatter.
  • Prettier plugin Java - Java specific formatting.
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft