Skip to content

Commit

Permalink
retain the extensions scanning order since they are cached
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Jan 7, 2025
1 parent e258958 commit e0a20ab
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export abstract class AbstractExtensionsScannerService extends Disposable implem
private async scanDefaultSystemExtensions(language: string | undefined): Promise<IRelaxedScannedExtension[]> {
this.logService.trace('Started scanning system extensions');
const extensionsScannerInput = await this.createExtensionScannerInput(this.systemExtensionsLocation, false, ExtensionType.System, language, true, undefined, this.getProductVersion());
const extensionsScanner = !extensionsScannerInput.devMode ? this.systemExtensionsCachedScanner : this.extensionsScanner;
const extensionsScanner = extensionsScannerInput.devMode ? this.extensionsScanner : this.systemExtensionsCachedScanner;
const result = await extensionsScanner.scanExtensions(extensionsScannerInput);
this.logService.trace('Scanned system extensions:', result.length);
return result;
Expand Down Expand Up @@ -609,16 +609,15 @@ class ExtensionsScanner extends Disposable {
if (!scannedProfileExtensions.length) {
return [];
}
const extensions: IRelaxedScannedExtension[] = [];
await Promise.all(scannedProfileExtensions.map(async extensionInfo => {
if (!filter(extensionInfo)) {
return;
}
const extensionScannerInput = new ExtensionScannerInput(extensionInfo.location, input.mtime, input.applicationExtensionslocation, input.applicationExtensionslocationMtime, input.profile, input.profileScanOptions, input.type, input.validate, input.productVersion, input.productDate, input.productCommit, input.devMode, input.language, input.translations);
const extension = await this.scanExtension(extensionScannerInput, extensionInfo);
extensions.push(extension);
}));
return extensions;
const extensions = await Promise.all<IRelaxedScannedExtension | null>(
scannedProfileExtensions.map(async extensionInfo => {
if (filter(extensionInfo)) {
const extensionScannerInput = new ExtensionScannerInput(extensionInfo.location, input.mtime, input.applicationExtensionslocation, input.applicationExtensionslocationMtime, input.profile, input.profileScanOptions, input.type, input.validate, input.productVersion, input.productDate, input.productCommit, input.devMode, input.language, input.translations);
return this.scanExtension(extensionScannerInput, extensionInfo);
}
return null;
}));
return coalesce(extensions);
}

async scanOneOrMultipleExtensions(input: ExtensionScannerInput): Promise<IRelaxedScannedExtension[]> {
Expand Down

0 comments on commit e0a20ab

Please sign in to comment.