make the designer event based (#17472)

* make the designer event based

* pr comments
This commit is contained in:
Alan Ren
2021-10-22 17:25:12 -07:00
committed by GitHub
parent 70f6eebc5a
commit 4ba192a5c3
7 changed files with 284 additions and 128 deletions

View File

@@ -29,7 +29,9 @@ export class TableDesignerInput extends EditorInput {
super();
this._designerComponentInput = this._instantiationService.createInstance(TableDesignerComponentInput, this._provider, this._tableInfo);
this._register(this._designerComponentInput.onStateChange((e) => {
this._onDidChangeDirty.fire();
if (e.currentState.dirty !== e.previousState.dirty) {
this._onDidChangeDirty.fire();
}
}));
const existingNames = editorService.editors.map(editor => editor.getName());
@@ -66,7 +68,7 @@ export class TableDesignerInput extends EditorInput {
}
override isSaving(): boolean {
return this._designerComponentInput.saving;
return this._designerComponentInput.pendingAction === 'save';
}
override async save(group: GroupIdentifier, options?: ISaveOptions): Promise<IEditorInput | undefined> {