mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-26 11:26:56 +01:00
Pass identifier rather than extension object in result context
This commit is contained in:
@@ -673,11 +673,14 @@ class ExtensionsContributions extends Disposable implements IWorkbenchContributi
|
||||
],
|
||||
icon: installWorkspaceRecommendedIcon,
|
||||
run: async () => {
|
||||
const outdated = this.extensionsWorkbenchService.outdated;
|
||||
const results = await this.extensionsWorkbenchService.updateAll();
|
||||
results.forEach((result) => {
|
||||
if (result.error && result.context?.extension) {
|
||||
const extension: IExtension = result.context.extension;
|
||||
runAction(this.instantiationService.createInstance(PromptExtensionInstallFailureAction, extension, extension.latestVersion, InstallOperation.Update, result.error));
|
||||
if (result.error && result.context?.extensionIdentifier) {
|
||||
const extension: IExtension | undefined = outdated.find((extension) => extension.identifier === result.context?.extensionIdentifier);
|
||||
if (extension) {
|
||||
runAction(this.instantiationService.createInstance(PromptExtensionInstallFailureAction, extension, extension.latestVersion, InstallOperation.Update, result.error));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1375,7 +1375,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
|
||||
installPreReleaseVersion: extension.local?.isPreReleaseVersion,
|
||||
profileLocation: this.userDataProfileService.currentProfile.extensionsResource,
|
||||
donotIncludePackAndDependencies: true,
|
||||
context: { extension }, // Provide extension as context in result so result reporting can use its properties
|
||||
context: { extensionIdentifier: extension.identifier }, // Provide this in result so result reporting can look it up and use its properties
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user