-
Enhancement
-
Resolution: Obsolete
-
Major
-
None
-
None
-
None
We need a buffer manager in the WS agent for two reasons:
1. Language servers may request to be informed of changes either by receiving deltas on the current content or by being sent the whole file contents on each event. Since only the WS agent communicates with individual language servers, only the WS agent can construct the appropriate messages. For that, we need to know both the file contents and the most recent delta.
2. Language servers can safely assume that the sequence of documents is well formed, i.e. didOpen, didChange*, didClose (see https://github.com/Microsoft/language-server-protocol/issues/216). In order to guarantee this property, we need to know which language servers have been sent "didOpen" for a particular file. If we get a "didOpen" from the front end for a file that the language servers already consider open, we need to send a "didClose" first, in order to prevent undefined behaviour (i.e. crashes) from lanauge servers.