From 40357ffcb57e97c48d1db9131159fa30e41d4fec Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Thu, 20 Dec 2018 11:56:09 +0100 Subject: [PATCH] Fixes #609: How should a server respond to invalid notifications (for ex textDocument/didChange with invalid line/col info)? --- specification.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification.md b/specification.md index 27ae91d..bb53b27 100644 --- a/specification.md +++ b/specification.md @@ -4316,6 +4316,8 @@ Language servers usually run in a separate process and client communicate with t - if a client sends a request to the server and the client state changes in a way that the result will be invalid it should cancel the server request and ignore the result. If necessary it can resend the request to receive an up to date result. - if a server detects a state change that invalidates the result of a request in execution the server can error these requests with `ContentModified`. If clients receive a `ContentModified` error, it generally should not show it in the UI for the end-user. Clients can resend the request if appropriate. +- if servers end up in an inconsistent state they should log this to the client using the `window/logMessage` request. If they can't recover from this the best they can do right now is to exit themselves. We are considering an [extension to the protocol](https://github.com/Microsoft/language-server-protocol/issues/646) that allows servers to request a restart on the client side. +- if a client notices that a server exists unexpectedly it should try to restart the server. However clients should be careful to not restart a crashing server endlessly. VS Code for example doesn't restart a server if it crashes 5 times in the last 180 seconds. ### Change Log