mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-13 23:44:09 +01:00
Filter unsupported items from 'Add Context' quick pick (#270660)
This commit is contained in:
@@ -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) => {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user