eclipse-sprotty / sprotty-vscode

sprotty-vscode
Eclipse Public License 2.0
58 stars 24 forks source link

sprotty (diagram &text) synchronized #93

Closed zrwsmd closed 1 year ago

zrwsmd commented 1 year ago

why my colleague local sprotty project can achieve when diagram changed(right part),corresponding left part also synchronized change,i found new project(sprotty-vscode-master) can not synchronized since right part is readonly .he once used old sprotty-vscode project without langium module few years ago,only have xtext module,it is because xtext can achieve it?desperately for your answer,thanks ahead image

spoenemann commented 1 year ago

We simply haven't implemented the editing features in the Langium-based example yet. But it's totally possible to do the same as we did with Xtext.

zrwsmd commented 1 year ago

how it achieved when right part change,left part changed too,like you said code is in https://github.com/eclipse-sprotty/sprotty-vscode/blob/master/packages/sprotty-vscode-webview/src/lsp/editing/delete-with-workspace-edit.ts.but i just did not understand the code,can you briefly describe how it worked?

spoenemann commented 1 year ago

The WorkspaceEdit that is created in that code replaces the text region of the selected element with an empty string, which results in the deletion of that element.