mirror of
https://github.com/microsoft/language-server-protocol.git
synced 2025-12-23 08:48:16 +00:00
Fixes #609: How should a server respond to invalid notifications (for ex textDocument/didChange with invalid line/col info)?
This commit is contained in:
parent
971966008a
commit
40357ffcb5
1 changed files with 2 additions and 0 deletions
|
|
@ -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.
|
||||
|
||||
### <a href="#changeLog" name="changeLog" class="anchor">Change Log</a>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue