org.eclipse.glsp.server.features.sourcemodelwatcher.SourceModelChangedAction.SourceModelChangedAction(String) is not working as expected #776
-
I am using https://github.com/eclipse-glsp/glsp-vscode-integration project where I have created 3 custom editors for same file extension (3 GLSP diagram editors). Recently org.eclipse.glsp.server.features.sourcemodelwatcher.SourceModelChangedAction.SourceModelChangedAction(String) was added to close custom editors when file is renamed and it is working fine when we rename from vscode(file rename from explorer view). But when I trigger SourceModelChangedAction("newFile.wf") from server side then only message "The source model newFile.wf has changed. You might want to consider reloading." will be shown but existing editor will not be closed also new editor with file name newFile.wf is not created. When we invoke SourceModelChangedAction from server side then old editors is not closed. Is my understating is correct? My requirement: I want to close editor and reopen editor with new file name where SourceModelChangedAction is triggered from server side. Steps to reproduce the issue:
Expected: New editor with file name newFile.wf should we created(old editors should be closed). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The The default implementation in the glsp-client is the In Theia, there is a The VS Code integration doesn't register a The behavior you are describing in case of a rename is actually coming from plain VS Code: So if you want a behavior that is similar to the one described above for Theia, you'd need to bind a VS Code specific implementation of the As this is pretty generic behavior, please feel free to open PR and add it directly to the default |
Beta Was this translation helpful? Give feedback.
The
SourceModelChangedAction
is an indication, typically sent from the server to the client, that the original source model has changed. From a protocol point of view, clients may react as they see fit though.The default implementation in the glsp-client is the
SourceModelChangedActionHandler
. As can be seen in the implementation, the default implementation checks if there is aExternalSourceModelChangedHandler
registered. If yes, it'll invoke it, if not, it'll just show a notification.In Theia, there is a
ExternalSourceModelChangedHandler
registered, which will show a dialog and ask the user whether they want to re-open the editor or not. The implementation is in theTheiaSourceModelCh…