@@ -217,16 +217,16 @@ export class InlineChatController implements IEditorContribution {
217
217
218
218
private async [ State . CREATE_SESSION ] ( options : InlineChatRunOptions ) : Promise < State . CANCEL | State . INIT_UI | State . PAUSE > {
219
219
console . log ( 'inside of CREATE_SESSION' ) ;
220
- console . log ( 'this._activeSession : ' , this . _activeSession ) ;
220
+ console . log ( 'inside of CREATE_SESSION, this._activeSession : ' , this . _activeSession ) ;
221
221
if ( this . _activeSession ) {
222
- console . log ( 'before clearing the session store' ) ;
222
+ console . log ( 'inside of CREATE_SESSION, before clearing the session store' ) ;
223
223
this . _sessionStore . clear ( ) ;
224
- console . log ( 'before releasing teh session' ) ;
224
+ console . log ( 'inside of CREATE_SESSION, before releasing the session' ) ;
225
225
this . _inlineChatSessionService . releaseSession ( this . _activeSession ) ;
226
- console . log ( 'before calling pause' ) ;
226
+ console . log ( 'inside of CREATE_SESSION, before calling pause' ) ;
227
227
await this [ State . PAUSE ] ( ) ;
228
228
}
229
- console . log ( 'this._activeSession after the cleaning : ' , this . _activeSession ) ;
229
+ console . log ( 'inside of CREATE_SESSION, this._activeSession after the cleaning : ' , this . _activeSession ) ;
230
230
assertType ( this . _activeSession === undefined ) ;
231
231
assertType ( this . _editor . hasModel ( ) ) ;
232
232
@@ -239,7 +239,7 @@ export class InlineChatController implements IEditorContribution {
239
239
if ( ! session ) {
240
240
const createSessionCts = new CancellationTokenSource ( ) ;
241
241
const msgListener = Event . once ( this . _messages . event ) ( m => {
242
- console . log ( 'inside of the msgListener code of CREATE_SESSION' ) ;
242
+ console . log ( 'inside of CREATE_SESSION, inside of the msgListener code of CREATE_SESSION' ) ;
243
243
this . _log ( 'state=_createSession) message received' , m ) ;
244
244
if ( m === Message . ACCEPT_INPUT ) {
245
245
// user accepted the input before having a session
@@ -292,7 +292,7 @@ export class InlineChatController implements IEditorContribution {
292
292
293
293
private async [ State . INIT_UI ] ( options : InlineChatRunOptions ) : Promise < State . WAIT_FOR_INPUT | State . SHOW_RESPONSE | State . APPLY_RESPONSE > {
294
294
console . log ( 'inside of init ui' ) ;
295
- console . log ( 'this._activeSession : ' , this . _activeSession ) ;
295
+ console . log ( 'inside of INIT_UI, this._activeSession : ' , this . _activeSession ) ;
296
296
assertType ( this . _activeSession ) ;
297
297
298
298
// hide/cancel inline completions when invoking IE
@@ -353,20 +353,20 @@ export class InlineChatController implements IEditorContribution {
353
353
354
354
if ( editIsOutsideOfWholeRange ) {
355
355
this . _log ( 'text changed outside of whole range, FINISH session' ) ;
356
- console . log ( 'before the third finish existing session' ) ;
356
+ console . log ( 'inside of INIT_UI, before the third finish existing session' ) ;
357
357
this . finishExistingSession ( ) ;
358
358
}
359
359
} ) ) ;
360
360
361
361
if ( ! this . _activeSession . lastExchange ) {
362
- console . log ( 'before waiting for input' ) ;
362
+ console . log ( 'inside of INIT_UI, before waiting for input' ) ;
363
363
return State . WAIT_FOR_INPUT ;
364
364
} else if ( options . isUnstashed ) {
365
365
delete options . isUnstashed ;
366
- console . log ( 'before apply response' ) ;
366
+ console . log ( 'inside of INIT_UI, before apply response' ) ;
367
367
return State . APPLY_RESPONSE ;
368
368
} else {
369
- console . log ( 'before show response' ) ;
369
+ console . log ( 'inside of INIT_UI, before show response' ) ;
370
370
return State . SHOW_RESPONSE ;
371
371
}
372
372
}
@@ -386,6 +386,8 @@ export class InlineChatController implements IEditorContribution {
386
386
387
387
388
388
private async [ State . WAIT_FOR_INPUT ] ( options : InlineChatRunOptions ) : Promise < void | State . ACCEPT | State . CANCEL | State . PAUSE | State . WAIT_FOR_INPUT | State . MAKE_REQUEST > {
389
+ console . log ( 'inside of wait for input' ) ;
390
+
389
391
assertType ( this . _activeSession ) ;
390
392
assertType ( this . _strategy ) ;
391
393
@@ -406,7 +408,7 @@ export class InlineChatController implements IEditorContribution {
406
408
} else {
407
409
const barrier = new Barrier ( ) ;
408
410
const msgListener = Event . once ( this . _messages . event ) ( m => {
409
- console . log ( 'inside of msgListener of WAIT FOR INPUT ' ) ;
411
+ console . log ( 'inside of WAIT_FOR_INPUT, inside of msgListener ' ) ;
410
412
this . _log ( 'state=_waitForInput) message received' , m ) ;
411
413
message = m ;
412
414
barrier . open ( ) ;
@@ -418,16 +420,14 @@ export class InlineChatController implements IEditorContribution {
418
420
this . _zone . value . widget . selectAll ( ) ;
419
421
420
422
if ( message & ( Message . CANCEL_INPUT | Message . CANCEL_SESSION ) ) {
421
- console . log ( 'inside of wait for input' ) ;
422
- console . log ( 'entered into the case when message cancel session' ) ;
423
+ console . log ( 'inside of WAIT_FOR_INPUT,entered into the case when message cancel session' ) ;
423
424
await this [ State . CANCEL ] ( ) ;
424
425
return ;
425
426
// return State.CANCEL;
426
427
}
427
428
428
429
if ( message & Message . ACCEPT_SESSION ) {
429
- console . log ( 'inside of wait for input' ) ;
430
- console . log ( 'entered into the case when message accept' ) ;
430
+ console . log ( 'inside of WAIT_FOR_INPUT,entered into the case when message accept' ) ;
431
431
await this [ State . ACCEPT ] ( ) ;
432
432
return ;
433
433
// return State.ACCEPT;
@@ -681,7 +681,7 @@ export class InlineChatController implements IEditorContribution {
681
681
}
682
682
683
683
private async [ State . ACCEPT ] ( ) {
684
- console . log ( 'inside of accept ' ) ;
684
+ console . log ( 'inside of State.ACCEPT ' ) ;
685
685
assertType ( this . _activeSession ) ;
686
686
assertType ( this . _strategy ) ;
687
687
this . _sessionStore . clear ( ) ;
@@ -835,12 +835,15 @@ export class InlineChatController implements IEditorContribution {
835
835
if ( this . _activeSession ) {
836
836
if ( this . _activeSession . editMode === EditMode . Preview ) {
837
837
this . _log ( 'finishing existing session, using CANCEL' , this . _activeSession . editMode ) ;
838
+ console . log ( 'before cancelling inside of finish existing session' ) ;
838
839
this . cancelSession ( ) ;
839
840
} else {
840
841
this . _log ( 'finishing existing session, using APPLY' , this . _activeSession . editMode ) ;
842
+ console . log ( 'before accepting inside of finish existing session' ) ;
841
843
this . acceptSession ( ) ;
842
844
}
843
845
}
846
+ console . log ( 'at the end of finish existing session' ) ;
844
847
}
845
848
846
849
unstashLastSession ( ) : Session | undefined {
0 commit comments