From 5a8d73cebb1030a9d44a81cd62d3a701b7bfb553 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 20 Aug 2024 12:40:44 +0200 Subject: [PATCH] debt - simplify logic around `lastInput` (#226046) --- .../contrib/inlineChat/browser/inlineChatSession.ts | 11 ----------- .../browser/inlineChatSessionServiceImpl.ts | 2 -- 2 files changed, 13 deletions(-) diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.ts index bafa69df542..d120ffeb811 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.ts @@ -128,7 +128,6 @@ export class SessionWholeRange { export class Session { - private _lastInput: SessionPrompt | undefined; private _isUnstashed: boolean = false; private readonly _exchanges: SessionExchange[]; private readonly _startTime = new Date(); @@ -155,7 +154,6 @@ export class Session { readonly hunkData: HunkData, readonly chatModel: ChatModel, exchanges?: SessionExchange[], - lastInput?: SessionPrompt, ) { this.textModelNAltVersion = textModelN.getAlternativeVersionId(); this._teldata = { @@ -173,15 +171,6 @@ export class Session { responseTypes: '' }; this._exchanges = exchanges ?? []; - this._lastInput = lastInput; - } - - addInput(input: SessionPrompt): void { - this._lastInput = input; - } - - get lastInput() { - return this._lastInput; } get isUnstashed(): boolean { diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts index 82745f05187..a6a4c9b4c46 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts @@ -127,7 +127,6 @@ export class InlineChatSessionServiceImpl implements IInlineChatSessionService { const { response } = e.request; const prompt = new SessionPrompt(e.request, session.textModelN.getAlternativeVersionId()); - session.addInput(prompt); lastResponseListener.value = response.onDidChange(() => { @@ -218,7 +217,6 @@ export class InlineChatSessionServiceImpl implements IInlineChatSessionService { store.add(new HunkData(this._editorWorkerService, textModel0, textModelN)), chatModel, options.session?.exchanges, // @ulugbekna: very hacky: we pass exchanges by reference because an exchange is added only on `addRequest` event from chat model which the migrated inline chat misses - options.session?.lastInput ); // store: key -> session