Skip to content

Commit 3c63244

Browse files
committed
go over this and try to understand why it does not work
1 parent d80f788 commit 3c63244

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ export class InlineChatController implements IEditorContribution {
180180
this._log('session starting inside of run');
181181
console.log('before finishExistingSession inside of run');
182182
await this.finishExistingSession();
183+
console.log('after finish existing session inside of run');
183184
this._stashedSession.clear();
184185
console.log('before calling create session inside of run');
185186
await this._nextState(State.CREATE_SESSION, options);
@@ -220,14 +221,15 @@ export class InlineChatController implements IEditorContribution {
220221
private async [State.CREATE_SESSION](options: InlineChatRunOptions): Promise<State.CANCEL | State.INIT_UI | State.PAUSE> {
221222
console.log('inside of CREATE_SESSION');
222223
console.log('inside of CREATE_SESSION, this._activeSession : ', this._activeSession);
223-
if (this._activeSession) {
224-
console.log('inside of CREATE_SESSION, before clearing the session store');
225-
this._sessionStore.clear();
226-
console.log('inside of CREATE_SESSION, before releasing the session');
227-
this._inlineChatSessionService.releaseSession(this._activeSession);
228-
console.log('inside of CREATE_SESSION, before calling pause');
229-
await this[State.PAUSE]();
230-
}
224+
// if (this._activeSession) {
225+
// console.log('inside of CREATE_SESSION, before clearing the session store');
226+
// this._sessionStore.clear();
227+
// console.log('inside of CREATE_SESSION, before releasing the session');
228+
// this._inlineChatSessionService.releaseSession(this._activeSession);
229+
// console.log('inside of CREATE_SESSION, before calling pause');
230+
// // Doesn't appear to be properly awaited?
231+
// await this[State.PAUSE]();
232+
// }
231233
console.log('inside of CREATE_SESSION, this._activeSession after the cleaning : ', this._activeSession);
232234
assertType(this._activeSession === undefined);
233235
assertType(this._editor.hasModel());
@@ -691,7 +693,7 @@ export class InlineChatController implements IEditorContribution {
691693
console.log('inside of State.ACCEPT, before strategy apply');
692694
await this._strategy.apply();
693695
console.log('inside of State.ACCEPT, after strategy apply');
694-
// TODO: ASK WHY DESPITE AWAIT AFTER STRATEFY NOT PRINTED BEFORE CREATE SESSION
696+
// TODO: ASK WHY DESPITE AWAIT, AFTER STRATEFY NOT PRINTED BEFORE CREATE SESSION
695697
} catch (err) {
696698
console.log('inside of State.ACCEPT, when error obtained');
697699
this._dialogService.error(localize('err.apply', "Failed to apply changes.", toErrorMessage(err)));
@@ -812,6 +814,7 @@ export class InlineChatController implements IEditorContribution {
812814

813815
acceptSession(): void {
814816
console.log('inside of acceptSession method');
817+
// Will fire a message which will be picked up by the controller and some other code will be run
815818
this._messages.fire(Message.ACCEPT_SESSION);
816819
}
817820

0 commit comments

Comments
 (0)