370
371
public async listPromptFilesForStorage(type: PromptsType, storage: PromptsStorage, token: CancellationToken): Promise<readonly IPromptPath[]> {
373
>
switch (storage) {
374
>
case PromptsStorage.extension:
375
>
promptPaths = await this.getExtensionPromptFiles(type, token);
376
>
break;
377
>
case PromptsStorage.local:
378
promptPaths = await this.fileLocator.listFiles(type, PromptsStorage.local, token).then(uris => uris.map(uri => ({ uri, storage: PromptsStorage.local, type } satisfies ILocalPromptPath)));
379
break;
381
promptPaths = await this.fileLocator.listFiles(type, PromptsStorage.user, token).then(uris => uris.map(uri => ({ uri, storage: PromptsStorage.user, type } satisfies IUserPromptPath)));
382
break;
384
promptPaths = this._pluginPromptFilesByType.get(type) ?? [];
385
break;
387
promptPaths = await this.getBuiltinPromptFiles(type, token);
388
break;
390
throw new Error(`[listPromptFilesForStorage] Unsupported prompt storage type: ${storage}`);
392
>
393
>
return promptPaths;
394
>
}
395
396
private getExtensionPromptFiles(type: PromptsType, token: CancellationToken): Promise<readonly IExtensionPromptPath[]> {