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
Java formatting options provided as initializationOptions.settings.java.format.settings.url are ignored #3108
Comments
This comment was marked as outdated.
This comment was marked as outdated.
I could verify the following:
Is this a mismatch in interpretation what empty settings in Hints welcome. |
indeed jdt.ls falls back to default settings when receiving an empty object. It expects the full settings. Partials won't be enough. |
Now I wonder: is this in accordance with the protocol specification? If I read https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_didChangeConfiguration I would rather interpret this as "send changes", not "send full settings". Though the "specification" is not very formal. |
@HaraldKi I think you're right, jdt.ls deviates from the spec here. |
Summary:
Despite providing a formatter specification xml which is actually read and seemingly understood by the language server, formatting does not change from the default.
My setup:
What I do:
I configure formatting with an xml file and I see the following things:
At initialization the format specification xml is send by the editor as follows (taken from the editor<->language server logs provided by eglot):
I added a log output to FormatterManager.java to verify the file is actually read.
The output from this log looks like:
Further I delete any
project_<hexcode>
directories from the workspace to force the language server to set up the project freshly. This project has neither a gradle nor maven build. Apart from the formatting it works as expected, in particular compiler errors are shown, etc.Yet, the formatting rules are clearly not applied.
I'll keep digging, but would be grateful for any hints.
The text was updated successfully, but these errors were encountered: