-
Notifications
You must be signed in to change notification settings - Fork 455
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
regression: java.format.settings.url no longer loads project .xml file #1827
Comments
Edit: I discovered it works with a (relative) file URL (absolute doesn't work because
Fwiw, the documentation for this setting says it can be a path. Maybe you want to fix? https://github.com/redhat-developer/vscode-java/wiki/Formatter-settings |
What is the workaround that we can use in the meantime? For example, assuming you have the formatter file in the Currently I have it set as |
I guess I should've read @rothfels answer more carefully 😅, since it is mentioned that the URI could be relative to the A workaround for the scenario I've described above is to set the # assuming your formatter xml file in on ${workspaceFolder}
# and is called 'eclipse-formatter.xml'
"java.format.settings.url": "file:./eclipse-formatter.xml" |
For me relative with ~ didn't work, nor did absolute, but adding file: did work, thank you @rothfels . |
Question: To mitigate this regression, we switched to the "file:" protocol as a workaround. After this regression is fixed, will the "file:" workaround break again or also continue to work, just to inform our developers. Thanks! |
@kristian It will work. |
Hi, "java.format.settings.url": "file://E:/tools/config/eclipse-java-mystyle.xml", |
@llgcode Could you try
|
Hi @snjeza <setting id="org.eclipse.jdt.core.formatter.lineSplit" value="200"/> When formatting, the code is splitted after 100 chars Thank you for your help |
Using this without the "file:" protocol again fails for me, is it also anyone else? Could there be another regression on this? |
The issue is related to eclipse-jdtls/eclipse.jdt.ls#1893 |
Some of our teammates just upgraded to the latest version of this extension and noticed that the formatter's behavior has changed.
Before upgrading extension:
Format document
-- no diffAfter upgrading extension:
Format document
-- large diffOur formatter configuration is and has been set from an .xml config file. Our
.vscode/settings.json
looks like this:I opened the project in Eclipse and imported the same code-style.xml file, and verified that the Eclipse formatter running with that config produces no diff.
I've concluded the formatter on the most recent version of this extension has regressed.
Environment
MacOS 11.2.1
openjdk version "15.0.1" 2020-10-20
1.54.1
v0.76.0
Steps To Reproduce
.vscode/settings.json
Format document
Current Result
Formatter generating unwanted diffs on newest extension version.
Expected Result
No formatting diffs on files that were formatted with prior extension version.
The text was updated successfully, but these errors were encountered: