From 6d7771d8a2f39ed837496deef125d15e45eb3ba1 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Sun, 19 May 2024 08:04:46 +0100 Subject: [PATCH] Register child instantiation service (#213010) ref #212879 --- src/vs/workbench/contrib/chat/browser/chatQuick.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/chatQuick.ts b/src/vs/workbench/contrib/chat/browser/chatQuick.ts index adc1a6eb79190..f40ad589c6078 100644 --- a/src/vs/workbench/contrib/chat/browser/chatQuick.ts +++ b/src/vs/workbench/contrib/chat/browser/chatQuick.ts @@ -206,14 +206,15 @@ class QuickChat extends Disposable { render(parent: HTMLElement): void { if (this.widget) { + // NOTE: if this changes, we need to make sure disposables in this function are tracked differently. throw new Error('Cannot render quick chat twice'); } - const scopedInstantiationService = this.instantiationService.createChild( + const scopedInstantiationService = this._register(this.instantiationService.createChild( new ServiceCollection([ IContextKeyService, this._register(this.contextKeyService.createScoped(parent)) ]) - ); + )); this.widget = this._register( scopedInstantiationService.createInstance( ChatWidget,