320
321
public async listPromptFiles(type: PromptsType, token: CancellationToken): Promise<readonly IPromptPath[]> {
323
>
if (!listPromise) {
324
>
listPromise = this.computeListPromptFiles(type, token);
325
>
if (!this.fileLocatorEvents[type]) {
326
return listPromise;
327
}
329
>
return listPromise;
330
>
}
331
return listPromise;
333
334
private async computeListPromptFiles(type: PromptsType, token: CancellationToken): Promise<readonly IPromptPath[]> {
336
>
this.fileLocator.listFiles(type, PromptsStorage.user, token).then(uris => uris.map(uri => ({ uri, storage: PromptsStorage.user, type } satisfies IUserPromptPath))),
337
>
this.fileLocator.listFiles(type, PromptsStorage.local, token).then(uris => uris.map(uri => ({ uri, storage: PromptsStorage.local, type } satisfies ILocalPromptPath))),
338
>
this.getExtensionPromptFiles(type, token),
339
>
this._pluginPromptFilesByType.get(type) ?? [],
340
>
this.getBuiltinPromptFiles(type, token),
341
>
]);
342
>
343
>
return prompts.flat();
344
>
}
345
346
/**