Skip to content

Commit 369585d

Browse files
committed
work in progress
1 parent 55613b5 commit 369585d

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,16 @@ export class InlineChatController implements IEditorContribution {
217217

218218
private async [State.CREATE_SESSION](options: InlineChatRunOptions): Promise<State.CANCEL | State.INIT_UI | State.PAUSE> {
219219
console.log('inside of CREATE_SESSION');
220-
console.log('this._activeSession : ', this._activeSession);
220+
console.log('inside of CREATE_SESSION, this._activeSession : ', this._activeSession);
221221
if (this._activeSession) {
222-
console.log('before clearing the session store');
222+
console.log('inside of CREATE_SESSION, before clearing the session store');
223223
this._sessionStore.clear();
224-
console.log('before releasing teh session');
224+
console.log('inside of CREATE_SESSION, before releasing the session');
225225
this._inlineChatSessionService.releaseSession(this._activeSession);
226-
console.log('before calling pause');
226+
console.log('inside of CREATE_SESSION, before calling pause');
227227
await this[State.PAUSE]();
228228
}
229-
console.log('this._activeSession after the cleaning : ', this._activeSession);
229+
console.log('inside of CREATE_SESSION, this._activeSession after the cleaning : ', this._activeSession);
230230
assertType(this._activeSession === undefined);
231231
assertType(this._editor.hasModel());
232232

@@ -239,7 +239,7 @@ export class InlineChatController implements IEditorContribution {
239239
if (!session) {
240240
const createSessionCts = new CancellationTokenSource();
241241
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');
243243
this._log('state=_createSession) message received', m);
244244
if (m === Message.ACCEPT_INPUT) {
245245
// user accepted the input before having a session
@@ -292,7 +292,7 @@ export class InlineChatController implements IEditorContribution {
292292

293293
private async [State.INIT_UI](options: InlineChatRunOptions): Promise<State.WAIT_FOR_INPUT | State.SHOW_RESPONSE | State.APPLY_RESPONSE> {
294294
console.log('inside of init ui');
295-
console.log('this._activeSession : ', this._activeSession);
295+
console.log('inside of INIT_UI, this._activeSession : ', this._activeSession);
296296
assertType(this._activeSession);
297297

298298
// hide/cancel inline completions when invoking IE
@@ -353,20 +353,20 @@ export class InlineChatController implements IEditorContribution {
353353

354354
if (editIsOutsideOfWholeRange) {
355355
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');
357357
this.finishExistingSession();
358358
}
359359
}));
360360

361361
if (!this._activeSession.lastExchange) {
362-
console.log('before waiting for input');
362+
console.log('inside of INIT_UI,before waiting for input');
363363
return State.WAIT_FOR_INPUT;
364364
} else if (options.isUnstashed) {
365365
delete options.isUnstashed;
366-
console.log('before apply response');
366+
console.log('inside of INIT_UI,before apply response');
367367
return State.APPLY_RESPONSE;
368368
} else {
369-
console.log('before show response');
369+
console.log('inside of INIT_UI,before show response');
370370
return State.SHOW_RESPONSE;
371371
}
372372
}
@@ -386,6 +386,8 @@ export class InlineChatController implements IEditorContribution {
386386

387387

388388
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+
389391
assertType(this._activeSession);
390392
assertType(this._strategy);
391393

@@ -406,7 +408,7 @@ export class InlineChatController implements IEditorContribution {
406408
} else {
407409
const barrier = new Barrier();
408410
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');
410412
this._log('state=_waitForInput) message received', m);
411413
message = m;
412414
barrier.open();
@@ -418,16 +420,14 @@ export class InlineChatController implements IEditorContribution {
418420
this._zone.value.widget.selectAll();
419421

420422
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');
423424
await this[State.CANCEL]();
424425
return;
425426
// return State.CANCEL;
426427
}
427428

428429
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');
431431
await this[State.ACCEPT]();
432432
return;
433433
// return State.ACCEPT;
@@ -681,7 +681,7 @@ export class InlineChatController implements IEditorContribution {
681681
}
682682

683683
private async [State.ACCEPT]() {
684-
console.log('inside of accept');
684+
console.log('inside of State.ACCEPT');
685685
assertType(this._activeSession);
686686
assertType(this._strategy);
687687
this._sessionStore.clear();
@@ -835,12 +835,15 @@ export class InlineChatController implements IEditorContribution {
835835
if (this._activeSession) {
836836
if (this._activeSession.editMode === EditMode.Preview) {
837837
this._log('finishing existing session, using CANCEL', this._activeSession.editMode);
838+
console.log('before cancelling inside of finish existing session');
838839
this.cancelSession();
839840
} else {
840841
this._log('finishing existing session, using APPLY', this._activeSession.editMode);
842+
console.log('before accepting inside of finish existing session');
841843
this.acceptSession();
842844
}
843845
}
846+
console.log('at the end of finish existing session');
844847
}
845848

846849
unstashLastSession(): Session | undefined {

0 commit comments

Comments
 (0)