Skip to content

Commit f5b64ee

Browse files
committed
some more polish
1 parent ad42860 commit f5b64ee

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,22 +144,20 @@ export class InteractiveEditorController implements IEditorContribution {
144144
this._logService.trace('[IE] session done or paused');
145145
}
146146

147+
// ---- state machine
148+
147149
private async _nextState(state: State, options: InteractiveEditorRunOptions | undefined): Promise<void> {
148150
this._logService.trace('[IE] setState to ', state);
149151
let nextState: State | undefined;
150152
switch (state) {
151153
case State.CREATE_SESSION:
152154
nextState = await this._createSession(options);
153-
delete options?.initialRange;
154-
delete options?.existingSession;
155155
break;
156156
case State.INIT_UI:
157157
nextState = await this._initUI();
158158
break;
159159
case State.WAIT_FOR_INPUT:
160160
nextState = await this._waitForInput(options);
161-
delete options?.message;
162-
delete options?.autoSend;
163161
break;
164162
case State.MAKE_REQUEST:
165163
nextState = await this._makeRequest();
@@ -204,6 +202,9 @@ export class InteractiveEditorController implements IEditorContribution {
204202
msgListener.dispose();
205203
}
206204

205+
delete options?.initialRange;
206+
delete options?.existingSession;
207+
207208
if (!session) {
208209
return State.DONE;
209210
}
@@ -303,11 +304,13 @@ export class InteractiveEditorController implements IEditorContribution {
303304
if (options?.message) {
304305
this._zone.widget.value = options?.message;
305306
this._zone.widget.selectAll();
307+
delete options?.message;
306308
}
307309

308310
let message = Message.NONE;
309311
if (options?.autoSend) {
310312
message = Message.ACCEPT_INPUT;
313+
delete options?.autoSend;
311314

312315
} else {
313316
const barrier = new Barrier();

0 commit comments

Comments
 (0)