Java formatting options provided as initializationOptions.settings.java.format.settings.url are ignored #1377
-
I wrote already a bug report to eclipse.jdt.ls, mostly to start documenting this somewhat: eclipse-jdtls/eclipse.jdt.ls#3108 , but I get the impression that I misunderstand a concept of configuration of eglot or it may actually be a problem with eglot. My goal: tell the language server how to format Java. Somewhat inspired from #888 I do this: (with-eval-after-load 'eglot
(add-to-list
'eglot-server-programs
`(java-mode
"jdtls"
:initializationOptions
(:settings (:java
(:format
(:enabled t :profile: "user-variant" :settings (:url "/home/user/.emacs.d/eclipse-formatter.xml"))
)
))
)
)
)
The By setting Question: Am I missing some additional configuration to tell eglot to send the whole Reading https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_didChangeConfiguration it says: interface DidChangeConfigurationParams{
/**
* The actual changed settings
*/
settings: LSPAny;
} which could be interpreted as saying: if we sent empty, nothing was changed. Yet the ecplise.jdt.ls takes this as a request to "clear" all settings (back to default). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
So I have to live with (setq eglot-connect-hook nil) which works at least at startup. After configuration changes I need to restart the server then. I hope this is workable for a while. I'll close this sometime soon or anyone with the keys to the empire close it if there is nothing more to say. |
Beta Was this translation helpful? Give feedback.
Are you doing that
setq
globally? I am asking because it will seteglot-connect-hook
for every server if you do it that way.If that is a problem for you, I suggest something along the following lines: