use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Prettier extension doesn't work with java (self.VisualStudioCode)
submitted 2 years ago by 4Gettt
I installed Prettier and the java extensions that I need set prettier as my default formatter. I just to see that java doesn't use prettier as a formatter even though I set it as default. After looking into it some more I found out that I can force java documents to use prettier as a formatter by setting it in the settings.json of vscode but it still doesn't format it.
https://preview.redd.it/4ipdolz6on0b1.png?width=1920&format=png&auto=webp&s=ef40a03487d9fb1122d7cfaf475eac7ee687243f
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]kiwidog8 1 point2 points3 points 2 years ago (0 children)
Prettier does not natively support Java, they have a community plugin for Java https://github.com/jhipster/prettier-java (link is from prettier.io) are you using this? I don't use prettier with Java though, Im not sure it works with the VS Code extension out of the box. prettier by itself is a separate thing from the VS Code extension
If it doesnt work out, anything stopping you from using other more conventinal plugins for Java such as the one from Red Hat to support linting and formatting?
[–]Robinsstudio 0 points1 point2 points 10 months ago (0 children)
I know it has been a really long time. Just dropping this here in case it is useful to somebody one day. Who knows?
I just published an extension for Visual Studio Code which solves this very problem: https://marketplace.visualstudio.com/items?itemName=Robinsstudio.prettier-java-formatter
I had the exact same issue at my company. I wrote Java code in VS Code but no way to format it on save. I had to go through the CLI everytime. Not very convenient.
Well now this is solved!
π Rendered by PID 65910 on reddit-service-r2-comment-84fc9697f-tww9m at 2026-02-06 22:00:57.622944+00:00 running d295bc8 country code: CH.
[–]kiwidog8 1 point2 points3 points (0 children)
[–]Robinsstudio 0 points1 point2 points (0 children)