mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Enable chat "move" commands on empty sessions (#183895)
* Enable chat "move" commands on empty sessions and also imported sessions * Fix command name
This commit is contained in:
parent
f6758dfc33
commit
7b87b701eb
|
@ -73,7 +73,7 @@ export function registerChatExportActions() {
|
|||
id: 'workbench.action.chat.import',
|
||||
title: {
|
||||
value: localize('chat.import.label', "Import Session") + '...',
|
||||
original: 'Export Session...'
|
||||
original: 'Import Session...'
|
||||
},
|
||||
category: CHAT_CATEGORY,
|
||||
precondition: CONTEXT_PROVIDER_EXISTS,
|
||||
|
|
|
@ -218,11 +218,13 @@ export class ChatService extends Disposable implements IChatService {
|
|||
}
|
||||
|
||||
getHistory(): IChatDetail[] {
|
||||
const sessions = Object.values(this._persistedSessions);
|
||||
const sessions = Object.values(this._persistedSessions)
|
||||
.filter(session => session.requests.length > 0);
|
||||
sessions.sort((a, b) => (b.creationDate ?? 0) - (a.creationDate ?? 0));
|
||||
|
||||
return sessions
|
||||
.filter(session => !this._sessionModels.has(session.sessionId))
|
||||
.filter(session => !session.isImported)
|
||||
.map(item => {
|
||||
return <IChatDetail>{
|
||||
sessionId: item.sessionId,
|
||||
|
@ -547,9 +549,7 @@ export class ChatService extends Disposable implements IChatService {
|
|||
throw new Error(`Unknown session: ${sessionId}`);
|
||||
}
|
||||
|
||||
if (model.getRequests().length && !model.isImported) {
|
||||
this._persistedSessions[sessionId] = model.toJSON();
|
||||
}
|
||||
this._persistedSessions[sessionId] = model.toJSON();
|
||||
|
||||
model.dispose();
|
||||
this._sessionModels.delete(sessionId);
|
||||
|
|
Loading…
Reference in a new issue