mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
inline chat: also migrate lastInput and exchanges from old session to new session of the migrated inline chat
This commit is contained in:
@@ -27,7 +27,7 @@ import { IChatService } from 'vs/workbench/contrib/chat/common/chatService';
|
||||
import { CTX_INLINE_CHAT_HAS_AGENT, EditMode } from 'vs/workbench/contrib/inlineChat/common/inlineChat';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput';
|
||||
import { EmptyResponse, ErrorResponse, HunkData, ReplyResponse, Session, SessionExchange, SessionWholeRange, StashedSession, TelemetryData, TelemetryDataClassification } from './inlineChatSession';
|
||||
import { EmptyResponse, ErrorResponse, HunkData, ReplyResponse, Session, SessionExchange, SessionPrompt, SessionWholeRange, StashedSession, TelemetryData, TelemetryDataClassification } from './inlineChatSession';
|
||||
import { IInlineChatSessionEndEvent, IInlineChatSessionEvent, IInlineChatSessionService, ISessionKeyComputer, Recording } from './inlineChatSessionService';
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ export class InlineChatSessionServiceImpl implements IInlineChatSessionService {
|
||||
this._sessions.clear();
|
||||
}
|
||||
|
||||
async createSession(editor: IActiveCodeEditor, options: { editMode: EditMode; wholeRange?: Range; chatModel?: ChatModel }, token: CancellationToken): Promise<Session | undefined> {
|
||||
async createSession(editor: IActiveCodeEditor, options: { editMode: EditMode; wholeRange?: Range; chatModel?: ChatModel; exchanges?: SessionExchange[]; lastInput?: SessionPrompt }, token: CancellationToken): Promise<Session | undefined> {
|
||||
|
||||
const agent = this._chatAgentService.getDefaultAgent(ChatAgentLocation.Editor);
|
||||
|
||||
@@ -96,7 +96,6 @@ export class InlineChatSessionServiceImpl implements IInlineChatSessionService {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
this._onWillStartSession.fire(editor);
|
||||
|
||||
const textModel = editor.getModel();
|
||||
@@ -215,7 +214,9 @@ export class InlineChatSessionServiceImpl implements IInlineChatSessionService {
|
||||
agent,
|
||||
store.add(new SessionWholeRange(textModelN, wholeRange)),
|
||||
store.add(new HunkData(this._editorWorkerService, textModel0, textModelN)),
|
||||
chatModel
|
||||
chatModel,
|
||||
options.exchanges,
|
||||
options.lastInput
|
||||
);
|
||||
|
||||
// store: key -> session
|
||||
|
||||
Reference in New Issue
Block a user