regression: java.format.settings.url no longer loads project .xml file
See original GitHub issueSome of our teammates just upgraded to the latest version of this extension and noticed that the formatter’s behavior has changed.
Before upgrading extension:
- open a file, run
Format document– no diff
After upgrading extension:
- open a file, run
Format document– large diff
Our formatter configuration is and has been set from an .xml config file. Our .vscode/settings.json looks like this:
"java.format.settings.url": "path/to/code-style.xml",
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
- Operating System:
MacOS 11.2.1 - JDK version:
openjdk version "15.0.1" 2020-10-20 - Visual Studio Code version:
1.54.1 - Java extension version:
v0.76.0
Steps To Reproduce
- Create custom code style .xml file
- Configure via
.vscode/settings.json - Run
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.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Java formatting and linting - Visual Studio Code
The property can be set to a URL or a local file path. If the formatter XML file contains more than one profile,...
Read more >Import google-java-format from Eclipse to VSCode
Another way to use it is to trigger command Java: Open Java formatter settings , and it will help you generate a default...
Read more >emacs-lsp/lsp-mode - Gitter
I'm hitting the “file watches” limitation because of the size of the project I'm working on, so I've gone ahead and added (setq...
Read more >Upgrade Notes | TeamCity On-Premises Documentation
This fix restores the intended behavior, but we recommend that you review your clean-up settings to ensure no builds will be cleaned up ......
Read more >xmlsave — Export or import dataset in XML format - Stata
include Stata DTD in XML file legible format XML to be more legible replace overwrite existing filename xmluse options. Description doctype(dta) load XML ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Edit: I discovered it works with a (relative) file URL (absolute doesn’t work because
${workspaceFolder}is not interpolated).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
I guess I should’ve read @rothfels answer more carefully 😅, since it is mentioned that the URI could be relative to the
${workspaceFolder}.A workaround for the scenario I’ve described above is to set the
java.format.settings.urlproperty like: