229
230
async scanUserExtensions(scanOptions: UserExtensionsScanOptions): Promise<IScannedExtension[]> {
232
>
const profileScanOptions: IProfileExtensionsScanOptions | undefined = this.uriIdentityService.extUri.isEqual(scanOptions.profileLocation, this.userDataProfilesService.defaultProfile.extensionsResource) ? { bailOutWhenFileNotFound: true } : undefined;
233
>
const extensionsScannerInput = await this.createExtensionScannerInput(scanOptions.profileLocation, true, ExtensionType.User, scanOptions.language, true, profileScanOptions, scanOptions.productVersion ?? this.getProductVersion());
234
>
const extensionsScanner = scanOptions.useCache && !extensionsScannerInput.devMode ? this.userExtensionsCachedScanner : this.extensionsScanner;
235
>
let extensions: IRelaxedScannedExtension[];
236
>
try {
237
>
extensions = await extensionsScanner.scanExtensions(extensionsScannerInput);
238
>
} catch (error) {
239
>
if (error instanceof ExtensionsProfileScanningError && error.code === ExtensionsProfileScanningErrorCode.ERROR_PROFILE_NOT_FOUND) {
240
>
await this.doInitializeDefaultProfileExtensions();
241
>
extensions = await extensionsScanner.scanExtensions(extensionsScannerInput);
242
>
} else {
243
throw error;
244
}
246
>
extensions = await this.applyScanOptions(extensions, ExtensionType.User, { includeInvalid: scanOptions.includeInvalid, pickLatest: true });
247
>
this.logService.trace('Scanned user extensions:', extensions.length);
248
>
return extensions;
249
>
}
250
251
async scanAllUserExtensions(scanOptions: { includeAllVersions?: boolean; includeInvalid: boolean } = { includeInvalid: true, includeAllVersions: true }): Promise<IScannedExtension[]> {