171
*/
172
public async listFiles(type: PromptsType, storage: PromptsStorage, token: CancellationToken): Promise<readonly URI[]> {
174
throw new Error(`Unsupported prompt file storage: ${storage}`);
175
}
177
>
const configuredLocations = this.getPromptSourceFolders(type);
178
>
const absoluteLocations = await this.toAbsoluteLocations(type, configuredLocations.filter(loc => loc.storage === storage));
179
>
180
>
if (storage === PromptsStorage.user && (type === PromptsType.agent || type === PromptsType.instructions || type === PromptsType.prompt)) {
181
absoluteLocations.push(this.userDataFolder);
182
}
184
>
const paths = new ResourceSet();
185
>
186
>
for (const { searchRoot, filePattern } of absoluteLocations) {
187
const files = (filePattern === undefined)
188
? await this.resolveFilesAtLocation(searchRoot, type, token) // if the location does not contain a glob pattern, resolve the location directly