Filter unsupported items from 'Add Context' quick pick (#270660)

This commit is contained in:
Ben Villalobos
2025-10-13 14:06:28 -07:00
committed by GitHub
parent 3ab0f19007
commit cc66fca78a
@@ -51,6 +51,9 @@ import { resizeImage } from '../imageUtils.js';
import { registerPromptActions } from '../promptSyntax/promptFileActions.js';
import { CHAT_CATEGORY } from './chatActions.js';
// Schemes that should not be available for chat context attach
const UNSUPPORTED_CONTEXT_SCHEMES = new Set(['webview-panel', 'walkThrough', 'vscode-settings']);
export function registerChatContextActions() {
registerAction2(AttachContextAction);
registerAction2(AttachFileToChatAction);
@@ -455,6 +458,12 @@ export class AttachContextAction extends Action2 {
const commandService = accessor.get(ICommandService);
const providerOptions: AnythingQuickAccessProviderRunOptions = {
filter: (pick) => {
if (isIQuickPickItemWithResource(pick) && pick.resource) {
return !UNSUPPORTED_CONTEXT_SCHEMES.has(pick.resource.scheme);
}
return true;
},
additionPicks,
handleAccept: async (item: IQuickPickServicePickItem | IContextPickItemItem, isBackgroundAccept: boolean) => {