add disposeTableDesigner (#17394)

This commit is contained in:
Alan Ren
2021-10-19 14:28:56 -07:00
committed by GitHub
parent ec8292adb7
commit 328ed83cb9
8 changed files with 57 additions and 21 deletions

View File

@@ -12,6 +12,7 @@ import * as azdata from 'azdata';
import { GroupIdentifier, IEditorInput, IRevertOptions, ISaveOptions } from 'vs/workbench/common/editor';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { onUnexpectedError } from 'vs/base/common/errors';
const NewTable: string = localize('tableDesigner.newTable', "New Table");
@@ -78,12 +79,13 @@ export class TableDesignerInput extends EditorInput {
}
override matches(otherInput: any): boolean {
// For existing tables, the table designer provider will give us unique id, we can use it to do the match.
// For new tables, we can do the match using their names.
return otherInput instanceof TableDesignerInput
&& this._provider.providerId === otherInput._provider.providerId
&& this._tableInfo.isNewTable === otherInput._tableInfo.isNewTable
&& (!this._tableInfo.isNewTable || this.getName() === otherInput.getName())
&& (this._tableInfo.isNewTable || this._tableInfo.id === otherInput._tableInfo.id);
&& this._tableInfo.id === otherInput._tableInfo.id;
}
override dispose(): void {
super.dispose();
this._provider.disposeTableDesigner(this._tableInfo).then(undefined, err => onUnexpectedError(err));
}
}