monaco-languageclient
monaco-languageclient copied to clipboard
Stopping the server timed out
Hi, I am using a WebSocketUrl connection and creating a LanguageClientWrapper to achieve intellisense for my editor.
When I shut down my server, and the websocket server is disposed, the client receives an unhandledrejection: "Stopping the server timed out". This comes from this code in LanguageClientWrapper:
messageTransports.reader.onClose(async () => {
await this.languageClient?.stop();
...
});
These seem to be the steps involved:
- server is started, client (browser) connects to the language server
- server is stopped,
messageTransports.reader.onClosecallback is fired this.langueClient.stopis called, which runs a Promise.race underneath with attempting to send a close message to the language server and a timeout- since the server has been stopped by this point it just always times out and caused an unhandledrejection