I noticed that server responses with an error to the shutdown request:
01:04:47.884 DEBUG l.core.MessageReader - Received headers: Content-Length: 59
01:04:47.884 DEBUG l.core.Connection - Received {"jsonrpc":"2.0","id":14,"method":"shutdown","params":null}
01:04:47.900 DEBUG l.core.MessageWriter - Content-Length: 199
{"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params","data":{"meaning":"Invalid method parameter(s).","error":{"obj":[{"msg":["command parameters must be given"],"args":[]}]}}},"id":14}
01:04:47.900 DEBUG l.core.MessageWriter - payload: {"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params","data":{"meaning":"Invalid method parameter(s).","error":{"obj":[{"msg":["command parameters must be given"],"args":[]}]}}},"id":14}
shutdown request is not supposed to have any parameters, so I think that the underlying LSP library doesn't handle it well.
It causes some extra lags in Atom (https://github.com/atom/atom-languageclient/issues/119) and I suspect after this response server never receives an exit request. By the way, I didn't find how exit is handled in the server.
I'm almost done in switching to lsp4j, which is a much more completed and tested implementation.
I hope all this issues with the protocol bindings are going away very soon.
OK, cool
lsp4j is not on the table anymore, let's fix this.
@gabro let me know if you have started with this. Otherwise I'll try to fix it.
VS Code does a trick by killing server process if it didn't reply to shutdown request in 5 sec. Atom doesn't, so every time I restart a server I have some zombie processes that I have to kill manually
馃拃馃敨
Most helpful comment
I'm almost done in switching to lsp4j, which is a much more completed and tested implementation.
I hope all this issues with the protocol bindings are going away very soon.