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

Visual studio code workspace settings for java #1289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jvermillard
Copy link
Contributor

Signed-off-by: Julien Vermillard [email protected]

@sbernard31
Copy link
Contributor

Does it need to install anything (some vscode plugin) or it works out of the box ?

@jvermillard
Copy link
Contributor Author

you need the official java extension (IIRC there is a popup proposing to install the first time you open a java file)

@sbernard31
Copy link
Contributor

I didn't get the popup but I guess this should be this one : https://marketplace.visualstudio.com/items?itemName=redhat.java

@@ -0,0 +1,6 @@
{
"java.format.settings.url": "https://raw.githubusercontent.com/eclipse/leshan/master/eclipse/eclipse-code-style.xml",
Copy link
Contributor

@sbernard31 sbernard31 Jul 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using the file in local repository ?

Suggested change
"java.format.settings.url": "https://raw.githubusercontent.com/eclipse/leshan/master/eclipse/eclipse-code-style.xml",
"java.format.settings.url": "./eclipse/eclipse-code-style.xml",

@sbernard31
Copy link
Contributor

Looking at : https://github.com/redhat-developer/vscode-java/wiki/Formatter-settings

I see that vscode also supports configuration in .setting folder.

You can also define the formatting preferences in your project's .settings/org.eclipse.jdt.core.prefs. It will override global formatting settings.

Currently this is possible to create those files with : mvn resources:copy-resources@configure-eclipse

But I guess, the root .vscode file is even better.

@jvermillard
Copy link
Contributor Author

I need to re-check but the last time I tried that it was not working. Apparently it a bug which was fixed in vscode long time ago 🤔

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

Successfully merging this pull request may close these issues.

2 participants