Reputation: 572
I'm trying to get the VS Code Redhat Java formatter (from the "Language Support for Java(TM) by Red Hat" extension) to work with a custom .xml, but nothing seems to work. I've tried:
The formatting is always the same, regardless of the settings in the XML file. The base XML file is the one mentioned here: https://code.visualstudio.com/docs/java/java-linting. Am I missing something?
Upvotes: 1
Views: 2050
Reputation: 56
It seems that double backward slash \\
should be used as the windows path splitor. So your setting should be D:\\Others\\formatter.xml
.
Besides, the path which is relatd to the workspace folder is supported, e.g., .vscode\\formatter.xml
points to profile formatter.xml
in .vscode
folder from workspace folder. No need to use URI format.
I suggest to use command Java: Open Java Formatter Settings
to automatically generate a formatting profile for you. After that, you can find it in workspace (if exists) settings.json. If you want to custom formatter rules, just to replace the content in that file.
Upvotes: 1