We're currently testing the connection between the Language Server with an instance of the EMFCloud.ModelServer. We're able to save/edit our Semantic Model in the Model Server workspace as it is described in the following answer. Basically, the Language Server handles our custom language using *.abcl
files and when the user saves changes in the file, the Language Server reacts on the didSave action and saves the AST (EMF model) in the Model Server (using XMI) in a file *.abc
(foo.abcl
converted to -> foo.abc
). The AST (EMF model) is now available for other EMF modelling editors (i.e. a Theia tree editor) where we can, for example rename a node or change attributes in a different manner.
What we're currently trying to achieve now is the Language Server to react on changes done by other editors on our AST (*.abc
files). To do so, the Language Server is subscribed to events on the Model Server and eventually receive a "fullUpdate" event indicating that the AST changed.
Our problem is how to proceed now. We can think about the following workflow:
- Model Server sends new model to Language Server (via subscription mechanism)
- The Language Server replaces the AST with the new model
- Serialize the new AST and cache it into a Document?
- At this point the *.abcl file (opened by the editor) is not in sync with the internal AST
- Maybe the Language Server forwards the serialization (text representation) to the editor ?
- Maybe the Language Server overwrites the *.abcl file in the workspace ?
Some guidance would be really appreciated
EDIT: Posted also a question on Eclipse Forums