Send extension ID for customizations (#305796)

This commit is contained in:
Paul
2026-03-27 15:31:09 -07:00
committed by GitHub
parent ca0ea977c6
commit b98ad1eadb
2 changed files with 6 additions and 4 deletions

View File

@@ -561,15 +561,16 @@ const newCommands: ApiCommand[] = [
new ApiCommand(
'vscode.extensionPromptFileProvider', '_listExtensionPromptFiles', 'Get all extension-contributed prompt files (custom agents, instructions, and prompt files).',
[],
new ApiCommandResult<IExtensionPromptFileResult[], { uri: vscode.Uri; type: PromptsType }[]>(
'A promise that resolves to an array of objects containing uri and type.',
new ApiCommandResult<IExtensionPromptFileResult[], { uri: vscode.Uri; type: PromptsType; extensionId: string }[]>(
'A promise that resolves to an array of objects containing uri, type, and extensionId.',
(value) => {
if (!value) {
return [];
}
return value.map(item => ({
uri: URI.revive(item.uri),
type: item.type
type: item.type,
extensionId: item.extensionId
}));
}
)

View File

@@ -157,6 +157,7 @@ export class ChatPromptFilesExtensionPointHandler implements IWorkbenchContribut
export interface IExtensionPromptFileResult {
readonly uri: UriComponents;
readonly type: PromptsType;
readonly extensionId: string;
}
/**
@@ -178,7 +179,7 @@ CommandsRegistry.registerCommand('_listExtensionPromptFiles', async (accessor):
const result: IExtensionPromptFileResult[] = [];
for (const file of [...agents, ...instructions, ...prompts, ...skills, ...hooks]) {
if (file.storage === PromptsStorage.extension) {
result.push({ uri: file.uri.toJSON(), type: file.type });
result.push({ uri: file.uri.toJSON(), type: file.type, extensionId: file.extension.identifier.value });
}
}