diff --git a/src/vs/workbench/browser/parts/compositePart.ts b/src/vs/workbench/browser/parts/compositePart.ts index 19c56d9b5092c..c86d7fd78f5cb 100644 --- a/src/vs/workbench/browser/parts/compositePart.ts +++ b/src/vs/workbench/browser/parts/compositePart.ts @@ -187,9 +187,9 @@ export abstract class CompositePart extends Part { this._register(that.onDidCompositeClose.event(e => this.onScopeClosed(e.getId()))); } }()); - const compositeInstantiationService = this.instantiationService.createChild(new ServiceCollection( + const compositeInstantiationService = this._register(this.instantiationService.createChild(new ServiceCollection( [IEditorProgressService, compositeProgressIndicator] // provide the editor progress service for any editors instantiated within the composite - )); + ))); const composite = compositeDescriptor.instantiate(compositeInstantiationService); const disposable = new DisposableStore(); diff --git a/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.ts b/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.ts index f0341568cf00f..279fc5713c440 100644 --- a/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.ts +++ b/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.ts @@ -203,10 +203,10 @@ export class AuxiliaryEditorPart { auxiliaryWindow.layout(); // Have a InstantiationService that is scoped to the auxiliary window - const instantiationService = this.instantiationService.createChild(new ServiceCollection( + const instantiationService = disposables.add(this.instantiationService.createChild(new ServiceCollection( [IStatusbarService, this.statusbarService.createScoped(statusbarPart, disposables)], [IEditorService, this.editorService.createScoped(editorPart, disposables)] - )); + ))); return { part: editorPart, diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index 4dc40e9aba93e..d847ef501378f 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -197,10 +197,10 @@ export class EditorGroupView extends Themable implements IEditorGroupView { this.progressBar.hide(); // Scoped instantiation service - this.scopedInstantiationService = this.instantiationService.createChild(new ServiceCollection( + this.scopedInstantiationService = this._register(this.instantiationService.createChild(new ServiceCollection( [IContextKeyService, this.scopedContextKeyService], [IEditorProgressService, this._register(new EditorProgressIndicator(this.progressBar, this))] - )); + ))); // Context keys this.resourceContext = this._register(this.scopedInstantiationService.createInstance(ResourceContextKey)); diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index 1fa0dcbeb395a..e467ab0270ea3 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -978,9 +978,9 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupsView { // Scoped instantiation service const scopedContextKeyService = this._register(this.contextKeyService.createScoped(this.container)); - this.scopedInstantiationService = this.instantiationService.createChild(new ServiceCollection( + this.scopedInstantiationService = this._register(this.instantiationService.createChild(new ServiceCollection( [IContextKeyService, scopedContextKeyService] - )); + ))); // Grid control this._willRestoreState = !options || options.restorePreviousState; diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index dc58c035fed62..c2ceeb2d7d72a 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -893,9 +893,9 @@ export class EditorStatusContribution extends Disposable implements IWorkbenchCo super(); // Main Editor Status - const mainInstantiationService = instantiationService.createChild(new ServiceCollection( + const mainInstantiationService = this._register(instantiationService.createChild(new ServiceCollection( [IEditorService, editorService.createScoped('main', this._store)] - )); + ))); this._register(mainInstantiationService.createInstance(EditorStatus, mainWindow.vscodeWindowId)); // Auxiliary Editor Status diff --git a/src/vs/workbench/browser/parts/editor/editorTabsControl.ts b/src/vs/workbench/browser/parts/editor/editorTabsControl.ts index 0031e18c565fd..e006ebd9040b0 100644 --- a/src/vs/workbench/browser/parts/editor/editorTabsControl.ts +++ b/src/vs/workbench/browser/parts/editor/editorTabsControl.ts @@ -146,9 +146,9 @@ export abstract class EditorTabsControl extends Themable implements IEditorTabsC super(themeService); this.contextMenuContextKeyService = this._register(this.contextKeyService.createScoped(parent)); - const scopedInstantiationService = this.instantiationService.createChild(new ServiceCollection( + const scopedInstantiationService = this._register(this.instantiationService.createChild(new ServiceCollection( [IContextKeyService, this.contextMenuContextKeyService], - )); + ))); this.resourceContext = this._register(scopedInstantiationService.createInstance(ResourceContextKey)); diff --git a/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts b/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts index f9fa228eb3935..fd3f51d356068 100644 --- a/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts +++ b/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts @@ -72,9 +72,9 @@ class LanguageStatusContribution extends Disposable implements IWorkbenchContrib super(); // --- main language status - const mainInstantiationService = instantiationService.createChild(new ServiceCollection( + const mainInstantiationService = this._register(instantiationService.createChild(new ServiceCollection( [IEditorService, editorService.createScoped('main', this._store)] - )); + ))); this._register(mainInstantiationService.createInstance(LanguageStatus)); // --- auxiliary language status