Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto formatting #358

Open
jdneo opened this issue Dec 4, 2023 Discussed in #357 · 5 comments
Open

Auto formatting #358

jdneo opened this issue Dec 4, 2023 Discussed in #357 · 5 comments

Comments

@jdneo
Copy link
Owner

jdneo commented Dec 4, 2023

Discussed in #357

Originally posted by SSmale December 4, 2023
I am looking for a way to get my VSCode setup to auto fix the check style issues (as best as it can) so that there can be a check on build and I can be confident that I will have met the standard, Is there a guide to do this?

@Maze-fr
Copy link

Maze-fr commented Jan 26, 2024

The only way I found is to use an Eclipse style / format configuration file, like this one :
https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml

Or download Eclipse, make your configuration and export it.

@MRDGH2821
Copy link

Would be great to have an option like this:

image

@Maze-fr
Copy link

Maze-fr commented Apr 21, 2024

The recent update of VSCode brought great things to the Java language support, but unfortunately, there is still no way to deal with formatting.
It looks like it's not an important feature for Java.

The most bothering thing is that I didn't find the list of possible properties, neither the available values for those properties.

@MRDGH2821
Copy link

MRDGH2821 commented Apr 21, 2024

The recent update of VSCode brought great things to the Java language support, but unfortunately, there is still no way to deal with formatting.
It looks like it's not an important feature for Java.

The most bothering thing is that I didn't find the list of possible properties, neither the available values for those properties.

The closest thing I found for formatting Java files is this - https://marketplace.visualstudio.com/items?itemName=JoseVSeb.google-java-format-for-vs-code

If you are using a different set of rules, then you are probably out of luck.

And yes, there is indeed a lack of proper configuration provisions.

@Maze-fr
Copy link

Maze-fr commented Apr 21, 2024

Exactly... almost everything I found is "use Google Java format without any flexibility or leave it".
The only one I found that allows to modify / set your own rules is the one I mentioned before.

Actually, there is also a plugin using JS prettier with rules for Java, but you need NodeJS installed, but if I do only Java, I don't want NodeJS around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants