eclipse.jdt.ls icon indicating copy to clipboard operation
eclipse.jdt.ls copied to clipboard

Behavior when formatting with custom LSP FormattingOptions and java.format.settings.url is specified

Open nicobao opened this issue 2 years ago • 0 comments

Hi!

Currently, the Eclipse LSP Server seems to use the LSP FormattingOptions in textDocument/formatting, textDocument/rangeFormatting and textDocument/onTypeFormatting (any formatting directives) over the formatting configuration file explicitly loaded from java.format.settings.url, which lead to inconsistencies:

https://github.com/microsoft/language-server-protocol/issues/1166#issue-762473730

These "options" aren't optional in the protocol so the client has to feed them with some values.

The LSP Team suggested for the servers to ignore these settings if it knows better (i.e if a formatting config file has been explicitly specified):

https://github.com/microsoft/language-server-protocol/issues/1166#issuecomment-1054484391

Is it possible that you ignore FormattingOptions when java.format.settings.url is specified?

Thanks for the review. Cheers!

nicobao avatar Apr 13 '22 08:04 nicobao