vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Java Formatter is broken somehow in my workspace

Open ziroc opened this issue 3 years ago • 6 comments

So I played around trying to use a custom formatter for Java. At some point my workspace broke and now I cannot format any Java code. I tried to remove every setting related to formatting. I used "clean the Java language server workspace" I deleted workspace caches in %userprofile%\AppData\Roaming\Code

Nothing works. Now I get the window "There is no formatter for Java installed" whenever I try to format some Java file.

I tried to set up a formater again. I added the file, used these settings: "java.format.settings.url": ".vscode/GoogleStyle.xml", And now I can run "Open Java Formatter Setting Wth Preview ", but I still cannot format my code.

Also I created another small project with one Java file and there the formatter works.

Environment
  • Operating System: Windows 11
  • JDK version: 11 and 17
  • Visual Studio Code version: 1.71.2
  • Java extension version: 1.11.0

ziroc avatar Oct 04 '22 13:10 ziroc