Explore parity between `server.LanguageServer` and `protocol.LanguageServerProtocol` methods
Closed this issue · 2 comments
In server.LanguageServer
we have a lot of methods that look like:
def apply_edit(
self, edit: WorkspaceEdit, label: Optional[str] = None
) -> WorkspaceApplyEditResponse:
"""Sends apply edit request to the client."""
return self.lsp.apply_edit(edit, label)
Therefore, they do nothing but call out to the underlying protocol.LanguageServerProtocol
method. There may be a good reason for this, but it isn't documented. There are some cases such as with publish_diagnostics
, where there is an advantage because the server.LanguageServer
method signature is simpler.
Let's either document the reasoning for the apparent repetition, or deprecate the duplicated server versions in favour of the protocol versions.
or deprecate the duplicated server versions in favour of the protocol versions.
Do you have any thoughts on the opposite?
Would it make sense to try and simplify the protocol classes (possibly even try to remove LanguageServerProtocol
completely??) and instead keep the methods on the LanguageServer
class and have them call the base notify
, send_request
, send_response
methods on the JsonRPCProtocol
class?