add commands to navigate between hunks (#205293)

https://github.com/microsoft/vscode/issues/203349
This commit is contained in:
Johannes Rieken
2024-02-15 15:57:24 +01:00
committed by GitHub
parent 80b556e8fb
commit 7215958b3c
5 changed files with 84 additions and 1 deletions

View File

@@ -640,6 +640,46 @@ export class ConfigureInlineChatAction extends AbstractInlineChatAction {
}
}
export class MoveToNextHunk extends AbstractInlineChatAction {
constructor() {
super({
id: 'inlineChat.moveToNextHunk',
title: localize2('moveToNextHunk', 'Move to Next Change'),
precondition: CTX_INLINE_CHAT_VISIBLE,
f1: true,
keybinding: {
weight: KeybindingWeight.WorkbenchContrib,
primary: KeyCode.F7
}
});
}
override runInlineChatCommand(accessor: ServicesAccessor, ctrl: InlineChatController, editor: ICodeEditor, ...args: any[]): void {
ctrl.moveHunk(true);
}
}
export class MoveToPreviousHunk extends AbstractInlineChatAction {
constructor() {
super({
id: 'inlineChat.moveToPreviousHunk',
title: localize2('moveToPreviousHunk', 'Move to Previous Change'),
f1: true,
precondition: CTX_INLINE_CHAT_VISIBLE,
keybinding: {
weight: KeybindingWeight.WorkbenchContrib,
primary: KeyMod.Shift | KeyCode.F7
}
});
}
override runInlineChatCommand(accessor: ServicesAccessor, ctrl: InlineChatController, editor: ICodeEditor, ...args: any[]): void {
ctrl.moveHunk(false);
}
}
export class CopyRecordings extends AbstractInlineChatAction {
constructor() {