mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-10 00:27:05 -06:00
sessions: make 'apply changes' show in working set multidiff (#281645)
Closes #281641
This commit is contained in:
parent
1c1c53a466
commit
5cb50d5bda
@ -326,17 +326,13 @@ export class ViewAllSessionChangesAction extends Action2 {
|
||||
});
|
||||
}
|
||||
|
||||
override async run(accessor: ServicesAccessor, ...args: unknown[]): Promise<void> {
|
||||
const chatWidgetService = accessor.get(IChatWidgetService);
|
||||
override async run(accessor: ServicesAccessor, sessionResource?: URI): Promise<void> {
|
||||
const agentSessionsService = accessor.get(IAgentSessionsService);
|
||||
const commandService = accessor.get(ICommandService);
|
||||
|
||||
const chatWidget = chatWidgetService.lastFocusedWidget ?? chatWidgetService.getWidgetsByLocations(ChatAgentLocation.Chat).find(w => w.supportsChangingModes);
|
||||
if (!chatWidget?.viewModel) {
|
||||
if (!URI.isUri(sessionResource)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const sessionResource = chatWidget.viewModel.model.sessionResource;
|
||||
const session = agentSessionsService.getSession(sessionResource);
|
||||
const changes = session?.changes;
|
||||
if (!(changes instanceof Array)) {
|
||||
@ -349,6 +345,7 @@ export class ViewAllSessionChangesAction extends Action2 {
|
||||
|
||||
if (resources.length > 0) {
|
||||
await commandService.executeCommand('_workbench.openMultiDiffEditor', {
|
||||
multiDiffSourceUri: sessionResource.with({ scheme: sessionResource.scheme + '-worktree-changes' }),
|
||||
title: localize('chatEditing.allChanges.title', 'All Session Changes'),
|
||||
resources,
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user