mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 23:35:54 +01:00
Merge pull request #303473 from microsoft/copilot/add-option-to-disable-auto-jump
Add `chat.editing.revealNextChangeOnResolve` setting to control auto-jump after keep/undo
This commit is contained in:
@@ -315,6 +315,11 @@ configurationRegistry.registerConfiguration({
|
||||
mode: 'auto'
|
||||
}
|
||||
},
|
||||
[ChatConfiguration.RevealNextChangeOnResolve]: {
|
||||
type: 'boolean',
|
||||
markdownDescription: nls.localize('chat.editing.revealNextChangeOnResolve', "Controls whether the editor automatically reveals the next change after keeping or undoing a chat edit."),
|
||||
default: true,
|
||||
},
|
||||
'chat.tips.enabled': {
|
||||
type: 'boolean',
|
||||
scope: ConfigurationScope.APPLICATION,
|
||||
|
||||
@@ -17,6 +17,7 @@ import { ContextKeyExpr } from '../../../../../platform/contextkey/common/contex
|
||||
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
|
||||
import { KeybindingWeight } from '../../../../../platform/keybinding/common/keybindingsRegistry.js';
|
||||
import { IListService } from '../../../../../platform/list/browser/listService.js';
|
||||
import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.js';
|
||||
import { resolveCommandsContext } from '../../../../browser/parts/editor/editorCommandsContext.js';
|
||||
import { ActiveEditorContext } from '../../../../common/contextkeys.js';
|
||||
import { EditorResourceAccessor, SideBySideEditor, TEXT_DIFF_EDITOR_ID } from '../../../../common/editor.js';
|
||||
@@ -211,6 +212,7 @@ abstract class KeepOrUndoAction extends ChatEditingEditorAction {
|
||||
override async runChatEditingCommand(accessor: ServicesAccessor, session: IChatEditingSession, entry: IModifiedFileEntry, _integration: IModifiedFileEntryEditorIntegration): Promise<void> {
|
||||
|
||||
const instaService = accessor.get(IInstantiationService);
|
||||
const configService = accessor.get(IConfigurationService);
|
||||
|
||||
if (this._keep) {
|
||||
session.accept(entry.modifiedURI);
|
||||
@@ -218,7 +220,9 @@ abstract class KeepOrUndoAction extends ChatEditingEditorAction {
|
||||
session.reject(entry.modifiedURI);
|
||||
}
|
||||
|
||||
await instaService.invokeFunction(openNextOrPreviousChange, session, entry, true);
|
||||
if (configService.getValue<boolean>(ChatConfiguration.RevealNextChangeOnResolve)) {
|
||||
await instaService.invokeFunction(openNextOrPreviousChange, session, entry, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,6 +274,7 @@ abstract class AcceptRejectHunkAction extends ChatEditingEditorAction {
|
||||
override async runChatEditingCommand(accessor: ServicesAccessor, session: IChatEditingSession, entry: IModifiedFileEntry, ctrl: IModifiedFileEntryEditorIntegration, ...args: unknown[]): Promise<void> {
|
||||
|
||||
const instaService = accessor.get(IInstantiationService);
|
||||
const configService = accessor.get(IConfigurationService);
|
||||
|
||||
if (this._accept) {
|
||||
await ctrl.acceptNearestChange(args[0] as IModifiedFileEntryChangeHunk | undefined);
|
||||
@@ -277,7 +282,7 @@ abstract class AcceptRejectHunkAction extends ChatEditingEditorAction {
|
||||
await ctrl.rejectNearestChange(args[0] as IModifiedFileEntryChangeHunk | undefined);
|
||||
}
|
||||
|
||||
if (entry.changesCount.get() === 0) {
|
||||
if (configService.getValue<boolean>(ChatConfiguration.RevealNextChangeOnResolve) && entry.changesCount.get() === 0) {
|
||||
// no more changes, move to next file
|
||||
await instaService.invokeFunction(openNextOrPreviousChange, session, entry, true);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ export enum ChatConfiguration {
|
||||
RestoreLastPanelSession = 'chat.restoreLastPanelSession',
|
||||
ExitAfterDelegation = 'chat.exitAfterDelegation',
|
||||
ExplainChangesEnabled = 'chat.editing.explainChanges.enabled',
|
||||
RevealNextChangeOnResolve = 'chat.editing.revealNextChangeOnResolve',
|
||||
GrowthNotificationEnabled = 'chat.growthNotification.enabled',
|
||||
ChatCustomizationMenuEnabled = 'chat.customizationsMenu.enabled',
|
||||
ChatCustomizationHarnessSelectorEnabled = 'chat.customizations.harnessSelector.enabled',
|
||||
|
||||
Reference in New Issue
Block a user