|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 | 5 |
|
6 | 6 | 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'; |
8 | 8 | import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
9 | 9 | import { toErrorMessage } from 'vs/base/common/errorMessage';
|
10 | 10 | import { Emitter, Event } from 'vs/base/common/event';
|
@@ -38,6 +38,7 @@ import { IChatService } from 'vs/workbench/contrib/chat/common/chatService';
|
38 | 38 | import { INotebookEditorService } from 'vs/workbench/contrib/notebook/browser/services/notebookEditorService';
|
39 | 39 | import { CellUri } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
40 | 40 | import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
| 41 | +import { Lazy } from 'vs/base/common/lazy'; |
41 | 42 |
|
42 | 43 | export const enum State {
|
43 | 44 | CREATE_SESSION = 'CREATE_SESSION',
|
@@ -86,7 +87,7 @@ export class InteractiveEditorController implements IEditorContribution {
|
86 | 87 | private _historyOffset: number = -1;
|
87 | 88 |
|
88 | 89 | private readonly _store = new DisposableStore();
|
89 |
| - private readonly _zone: IdleValue<InteractiveEditorZoneWidget>; |
| 90 | + private readonly _zone: Lazy<InteractiveEditorZoneWidget>; |
90 | 91 | private readonly _ctxHasActiveRequest: IContextKey<boolean>;
|
91 | 92 | private readonly _ctxLastResponseType: IContextKey<undefined | InteractiveEditorResponseType>;
|
92 | 93 | private readonly _ctxDidEdit: IContextKey<boolean>;
|
@@ -118,7 +119,7 @@ export class InteractiveEditorController implements IEditorContribution {
|
118 | 119 | this._ctxDidEdit = CTX_INTERACTIVE_EDITOR_DID_EDIT.bindTo(contextKeyService);
|
119 | 120 | this._ctxLastResponseType = CTX_INTERACTIVE_EDITOR_LAST_RESPONSE_TYPE.bindTo(contextKeyService);
|
120 | 121 | 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))); |
122 | 123 |
|
123 | 124 | this._store.add(this._editor.onDidChangeModel(async e => {
|
124 | 125 | if (this._activeSession || !e.newModelUrl) {
|
|
0 commit comments