@@ -144,22 +144,20 @@ export class InteractiveEditorController implements IEditorContribution {
144
144
this . _logService . trace ( '[IE] session done or paused' ) ;
145
145
}
146
146
147
+ // ---- state machine
148
+
147
149
private async _nextState ( state : State , options : InteractiveEditorRunOptions | undefined ) : Promise < void > {
148
150
this . _logService . trace ( '[IE] setState to ' , state ) ;
149
151
let nextState : State | undefined ;
150
152
switch ( state ) {
151
153
case State . CREATE_SESSION :
152
154
nextState = await this . _createSession ( options ) ;
153
- delete options ?. initialRange ;
154
- delete options ?. existingSession ;
155
155
break ;
156
156
case State . INIT_UI :
157
157
nextState = await this . _initUI ( ) ;
158
158
break ;
159
159
case State . WAIT_FOR_INPUT :
160
160
nextState = await this . _waitForInput ( options ) ;
161
- delete options ?. message ;
162
- delete options ?. autoSend ;
163
161
break ;
164
162
case State . MAKE_REQUEST :
165
163
nextState = await this . _makeRequest ( ) ;
@@ -204,6 +202,9 @@ export class InteractiveEditorController implements IEditorContribution {
204
202
msgListener . dispose ( ) ;
205
203
}
206
204
205
+ delete options ?. initialRange ;
206
+ delete options ?. existingSession ;
207
+
207
208
if ( ! session ) {
208
209
return State . DONE ;
209
210
}
@@ -303,11 +304,13 @@ export class InteractiveEditorController implements IEditorContribution {
303
304
if ( options ?. message ) {
304
305
this . _zone . widget . value = options ?. message ;
305
306
this . _zone . widget . selectAll ( ) ;
307
+ delete options ?. message ;
306
308
}
307
309
308
310
let message = Message . NONE ;
309
311
if ( options ?. autoSend ) {
310
312
message = Message . ACCEPT_INPUT ;
313
+ delete options ?. autoSend ;
311
314
312
315
} else {
313
316
const barrier = new Barrier ( ) ;
0 commit comments