eclipsesource / graphical-lsp

Graphical language server platform for building web-based diagram editors
https://www.eclipse.org/glsp
Eclipse Public License 2.0
36 stars 8 forks source link

After undo, The latest state is not saved. #244

Closed SunghwanJang closed 5 years ago

SunghwanJang commented 5 years ago

I tried the workflow example. If save action occurred after undo, it will not save the latest state. After saving, the view appears to have changed normally, but when I close and reopen the editor it is in a wrong state. How can I fix this?

planger commented 5 years ago

Unfortunately, undo/redo is not properly implemented yet. While client-side undo/redo is supported by the base framework (Sprotty), we need to properly support it on the server too, as in GLSP the server is responsible for actually performing the diagram manipulations. Currently, an undo is thus only performed on the client and the server isn't aware of this undo, which is why the undo is not effectively saved in the end.

Our current plan is to use EMF on the server as a base framework for the diagram model management (see #231), which would give us a command framework for model manipulation and with that undo/redo support on the server. Then we would only need to add proper action messages to allow the client to communicate the undo/redo to the server and with that properly support undo/redo across client and server.

SunghwanJang commented 5 years ago

Thanks for reply. With undo/redo support on the server, Will "CommandStack" be located in server? or both in client and server?

planger commented 5 years ago

There will be a command stack on the server and the client just notifies the server about the requested undo/redo actions the user wants to perform. At least that's our current idea of it. Do you have an opinion on that? What are you planning on using GLSP for? Thanks for your interest!

SunghwanJang commented 5 years ago

I am going to bring my GEF based modeling tools to the theia with minimal TypeScript or JavaScript. So I think sprotty/glsp would best fit.

planger commented 5 years ago

The work on undo and redo is tracked in #276 and its prerequisite #275