-
Notifications
You must be signed in to change notification settings - Fork 256
Panics when used with Sublime Text 3 LSP #1038
Comments
This error means rls is trying to read request text sent from the lsp client but part of it is in an incorrect format. Either the client is sending a message that doesn't match the protocol, or the languageserver-types lib rls uses isn't handling the protocol fully. To figure that out the actual json message would be very helpful. Rls logs it with trace logging strings starting with You may also be able to get the json clientside. |
I've wrapped Is there a more specific env var I can set to capture just these messages? Or can It may also be helpful if you use warn/error level for logging the message that failed to parse before panicking. |
env_logger can be module specific, I'd still just bosh stderr to a file
I agree. |
This reminds me of gluon-lang/lsp-types#46. I thought it was long gone? The module log is a lot cleaner; sometimes to get only RLS logs I used the |
With trace that's what I've got:
|
Thanks. It's a very tedious issue. The shutdown json includes an empty object as params, whereas the spec says {
"jsonrpc": "2.0",
"id": 2,
"method": "shutdown",
"params": {}
} Seems like the client library explicitly behaves this way. # client library `Request`
def to_payload(self, id) -> dict:
r = OrderedDict() # type: OrderedDict[str, Any]
r["jsonrpc"] = "2.0"
r["id"] = id
r["method"] = self.method
if self.params is not None:
r["params"] = self.params
else:
r["params"] = dict()
return r To resolve either or both
|
Actually looking more closely, the deserialise logic is in rls, so maybe we can be more permissive here. |
When used in Sublime, rls occasionally panics:
sublimelsp/LSP#399
rls-preview 0.130.0-beta (920a391 2018-08-03)
There are two problems here:
It panics.
There isn't much information about the panic, so it's hard to tell whether that's RLS's problem, or LSP's problem.
The text was updated successfully, but these errors were encountered: