mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 17:52:34 -05:00
Merge from vscode 2f984aad710215f4e4684a035bb02f55d1a9e2cc (#9819)
This commit is contained in:
@@ -8,7 +8,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import { IConstructorSignature0, IInstantiationService, BrandedService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { find } from 'vs/base/common/arrays';
|
||||
import { find, insert } from 'vs/base/common/arrays';
|
||||
import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export interface IEditorDescriptor {
|
||||
@@ -94,15 +94,11 @@ class EditorRegistry implements IEditorRegistry {
|
||||
registerEditor(descriptor: EditorDescriptor, inputDescriptors: readonly SyncDescriptor<EditorInput>[]): IDisposable {
|
||||
this.mapEditorToInputs.set(descriptor, inputDescriptors);
|
||||
|
||||
this.editors.push(descriptor);
|
||||
const remove = insert(this.editors, descriptor);
|
||||
|
||||
return toDisposable(() => {
|
||||
this.mapEditorToInputs.delete(descriptor);
|
||||
|
||||
const index = this.editors.indexOf(descriptor);
|
||||
if (index !== -1) {
|
||||
this.editors.splice(index, 1);
|
||||
}
|
||||
remove();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user