Skip to content

Commit e1b752c

Browse files
ulugbeknaCopilot
andcommitted
Extract permission storage keys to shared constants module
Move AUTOPILOT_DONT_SHOW_AGAIN_KEY and AUTO_APPROVE_DONT_SHOW_AGAIN_KEY to chat/common/chatPermissionStorageKeys.ts so both chatDeveloperActions and permissionPickerActionItem import from a lightweight shared module. This avoids chatDeveloperActions pulling in heavy widget/UI dependencies at startup via the permissionPickerActionItem import. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ac3b375 commit e1b752c

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { IChatService } from '../../common/chatService/chatService.js';
1818
import { ILanguageModelsService } from '../../common/languageModels.js';
1919
import { IChatWidgetService } from '../chat.js';
2020
import { IStorageService, StorageScope } from '../../../../../platform/storage/common/storage.js';
21-
import { AUTOPILOT_DONT_SHOW_AGAIN_KEY, AUTO_APPROVE_DONT_SHOW_AGAIN_KEY } from '../widget/input/permissionPickerActionItem.js';
21+
import { AUTOPILOT_DONT_SHOW_AGAIN_KEY, AUTO_APPROVE_DONT_SHOW_AGAIN_KEY } from '../../common/chatPermissionStorageKeys.js';
2222

2323
function uriReplacer(_key: string, value: unknown): unknown {
2424
if (URI.isUri(value)) {

src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ import { IStorageService, StorageScope, StorageTarget } from '../../../../../../
2929
// Track whether warnings have been shown this VS Code session
3030
const shownWarnings = new Set<ChatPermissionLevel>();
3131

32-
// Storage keys for persisting the user's choice to skip the warning dialog
33-
// across sessions when "Don't show again" is checked.
34-
export const AUTOPILOT_DONT_SHOW_AGAIN_KEY = 'chat.permissions.autopilot.dontShowWarningAgain';
35-
export const AUTO_APPROVE_DONT_SHOW_AGAIN_KEY = 'chat.permissions.autoApprove.dontShowWarningAgain';
32+
import { AUTOPILOT_DONT_SHOW_AGAIN_KEY, AUTO_APPROVE_DONT_SHOW_AGAIN_KEY } from '../../../common/chatPermissionStorageKeys.js';
3633

3734
function dontShowAgainKey(level: ChatPermissionLevel): string | undefined {
3835
if (level === ChatPermissionLevel.Autopilot) {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
// Storage keys for persisting the user's choice to skip the warning dialog
7+
// across sessions when "Don't show again" is checked.
8+
export const AUTOPILOT_DONT_SHOW_AGAIN_KEY = 'chat.permissions.autopilot.dontShowWarningAgain';
9+
export const AUTO_APPROVE_DONT_SHOW_AGAIN_KEY = 'chat.permissions.autoApprove.dontShowWarningAgain';

0 commit comments

Comments
 (0)