Skip to content

Commit 0479e05

Browse files
authored
use Lazy, not IdleValue for the IE widget held by the eager controller (microsoft#184048)
microsoft#183820
1 parent 3088f23 commit 0479e05

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorController.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { renderMarkdown } from 'vs/base/browser/markdownRenderer';
7-
import { Barrier, IdleValue, raceCancellationError } from 'vs/base/common/async';
7+
import { Barrier, raceCancellationError } from 'vs/base/common/async';
88
import { CancellationTokenSource } from 'vs/base/common/cancellation';
99
import { toErrorMessage } from 'vs/base/common/errorMessage';
1010
import { Emitter, Event } from 'vs/base/common/event';
@@ -38,6 +38,7 @@ import { IChatService } from 'vs/workbench/contrib/chat/common/chatService';
3838
import { INotebookEditorService } from 'vs/workbench/contrib/notebook/browser/services/notebookEditorService';
3939
import { CellUri } from 'vs/workbench/contrib/notebook/common/notebookCommon';
4040
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
41+
import { Lazy } from 'vs/base/common/lazy';
4142

4243
export const enum State {
4344
CREATE_SESSION = 'CREATE_SESSION',
@@ -86,7 +87,7 @@ export class InteractiveEditorController implements IEditorContribution {
8687
private _historyOffset: number = -1;
8788

8889
private readonly _store = new DisposableStore();
89-
private readonly _zone: IdleValue<InteractiveEditorZoneWidget>;
90+
private readonly _zone: Lazy<InteractiveEditorZoneWidget>;
9091
private readonly _ctxHasActiveRequest: IContextKey<boolean>;
9192
private readonly _ctxLastResponseType: IContextKey<undefined | InteractiveEditorResponseType>;
9293
private readonly _ctxDidEdit: IContextKey<boolean>;
@@ -118,7 +119,7 @@ export class InteractiveEditorController implements IEditorContribution {
118119
this._ctxDidEdit = CTX_INTERACTIVE_EDITOR_DID_EDIT.bindTo(contextKeyService);
119120
this._ctxLastResponseType = CTX_INTERACTIVE_EDITOR_LAST_RESPONSE_TYPE.bindTo(contextKeyService);
120121
this._ctxLastFeedbackKind = CTX_INTERACTIVE_EDITOR_LAST_FEEDBACK.bindTo(contextKeyService);
121-
this._zone = new IdleValue(() => this._store.add(_instaService.createInstance(InteractiveEditorZoneWidget, this._editor)));
122+
this._zone = new Lazy(() => this._store.add(_instaService.createInstance(InteractiveEditorZoneWidget, this._editor)));
122123

123124
this._store.add(this._editor.onDidChangeModel(async e => {
124125
if (this._activeSession || !e.newModelUrl) {

0 commit comments

Comments
 (0)