reveal next file when keep/undoing last hunk (#250821)

This commit is contained in:
Johannes Rieken
2025-06-06 11:59:12 +02:00
committed by GitHub
parent 507316dcb4
commit d49ebe603c
@@ -251,12 +251,20 @@ abstract class AcceptRejectHunkAction extends ChatEditingEditorAction {
);
}
override async runChatEditingCommand(_accessor: ServicesAccessor, _session: IChatEditingSession, _entry: IModifiedFileEntry, ctrl: IModifiedFileEntryEditorIntegration, ...args: any[]): Promise<void> {
override async runChatEditingCommand(accessor: ServicesAccessor, session: IChatEditingSession, entry: IModifiedFileEntry, ctrl: IModifiedFileEntryEditorIntegration, ...args: any[]): Promise<void> {
const instaService = accessor.get(IInstantiationService);
if (this._accept) {
await ctrl.acceptNearestChange(args[0]);
} else {
await ctrl.rejectNearestChange(args[0]);
}
if (entry.changesCount.get() === 0) {
// no more changes, move to next file
await instaService.invokeFunction(openNextOrPreviousChange, session, entry, true);
}
}
}