Skip to content

Commit d6565ff

Browse files
Ensure GLSP command stack is properly updated after external save
1 parent 726c51e commit d6565ff

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/server/src/glsp-server/common/cross-model-storage.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import {
88
ClientSession,
99
ClientSessionListener,
1010
ClientSessionManager,
11+
CommandStack,
12+
DefaultCommandStack,
1113
DisposableCollection,
1214
EditMode,
1315
GLSPServerError,
@@ -41,6 +43,7 @@ export class CrossModelStorage implements SourceModelStorage, ClientSessionListe
4143
@inject(ClientSessionManager) protected sessionManager: ClientSessionManager;
4244
@inject(ModelSubmissionHandler) protected submissionHandler: ModelSubmissionHandler;
4345
@inject(ActionDispatcher) protected actionDispatcher: ActionDispatcher;
46+
@inject(CommandStack) protected commandStack: DefaultCommandStack;
4447

4548
protected toDispose = new DisposableCollection();
4649

@@ -64,6 +67,11 @@ export class CrossModelStorage implements SourceModelStorage, ClientSessionListe
6467
const result = await this.updateAndSubmit(rootUri, event.document);
6568
this.actionDispatcher.dispatchAll(result);
6669
}
70+
}),
71+
this.state.modelService.onModelSaved(rootUri, async event => {
72+
if (this.state.clientId !== event.sourceClientId) {
73+
this.commandStack.saveIsDone();
74+
}
6775
})
6876
);
6977
}

0 commit comments

Comments
 (0)