Johannes Rieken
2024-08-22 16:18:40 +02:00
committed by GitHub
parent 557228e262
commit f12921b077
3 changed files with 101 additions and 62 deletions

View File

@@ -26,6 +26,7 @@ import { IPreferencesService } from 'vs/workbench/services/preferences/common/pr
import { ILogService } from 'vs/platform/log/common/log';
import { IChatService } from 'vs/workbench/contrib/chat/common/chatService';
import { CONTEXT_CHAT_INPUT_HAS_TEXT, CONTEXT_IN_CHAT_INPUT } from 'vs/workbench/contrib/chat/common/chatContextKeys';
import { HunkInformation } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSession';
CommandsRegistry.registerCommandAlias('interactiveEditor.start', 'inlineChat.start');
CommandsRegistry.registerCommandAlias('interactive.acceptChanges', ACTION_ACCEPT_CHANGES);
@@ -277,8 +278,8 @@ export class AcceptChanges extends AbstractInlineChatAction {
});
}
override async runInlineChatCommand(_accessor: ServicesAccessor, ctrl: InlineChatController): Promise<void> {
ctrl.acceptHunk();
override async runInlineChatCommand(_accessor: ServicesAccessor, ctrl: InlineChatController, _editor: ICodeEditor, hunk?: HunkInformation | any): Promise<void> {
ctrl.acceptHunk(hunk);
}
}
@@ -313,8 +314,8 @@ export class DiscardHunkAction extends AbstractInlineChatAction {
});
}
async runInlineChatCommand(_accessor: ServicesAccessor, ctrl: InlineChatController, _editor: ICodeEditor, ..._args: any[]): Promise<void> {
return ctrl.discardHunk();
async runInlineChatCommand(_accessor: ServicesAccessor, ctrl: InlineChatController, _editor: ICodeEditor, hunk?: HunkInformation | any): Promise<void> {
return ctrl.discardHunk(hunk);
}
}
@@ -510,8 +511,8 @@ export class ToggleDiffForChange extends AbstractInlineChatAction {
});
}
override runInlineChatCommand(accessor: ServicesAccessor, ctrl: InlineChatController): void {
ctrl.toggleDiff();
override runInlineChatCommand(_accessor: ServicesAccessor, ctrl: InlineChatController, _editor: ICodeEditor, hunkInfo: HunkInformation | any): void {
ctrl.toggleDiff(hunkInfo);
}
}