lsp
lsp copied to clipboard
Should ServerCapabilities depend upon ClientCapabilities?
Currently, inferCapabilities is passed a version of ClientCapabilities, and the passed client capabilities are used twice, once for RenameOptions and once for CodeActionKinds. That's a very small portion of the capabilities that could depend on ClientCapabilities. I'm of the position that ServerCapabilities shouldn't depend at all upon ClientCapabilities, after all, capabilities mean what we can do, not what we will do (which is to comply with the client capabilities in server code).
As long as no one objects I would like to stop passing ClientCapabilitise to inferCapabilities, and remove any code in there that refers to it.
Sadly, the spec says no...
RenameOptions may only be specified if the client states that it supports prepareSupport in its initial initialize request.
and
The server provides code actions. The
CodeActionOptions
return type is only valid if the client signals code action literal support via the propertytextDocument.codeAction.codeActionLiteralSupport
.
Stupid, but that's what it says. It would be super helpful to document this, though.