This commit is contained in:
Sandeep Somavarapu
2021-06-03 16:14:25 +02:00
parent 41163014f8
commit 01c6fb557d
2 changed files with 22 additions and 10 deletions

View File

@@ -105,15 +105,27 @@ export class MainThreadExtensionService implements MainThreadExtensionServiceSha
});
} else {
const enablementState = this._extensionEnablementService.getEnablementState(missingInstalledDependency);
this._notificationService.notify({
severity: Severity.Error,
message: localize('disabledDep', "Cannot activate the '{0}' extension because it depends on the '{1}' extension, which is disabled. Would you like to enable the extension and reload the window?", extName, missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name),
actions: {
primary: [new Action('enable', localize('enable dep', "Enable and Reload"), '', true,
() => this._extensionEnablementService.setEnablement([missingInstalledDependency], enablementState === EnablementState.DisabledGlobally ? EnablementState.EnabledGlobally : EnablementState.EnabledWorkspace)
.then(() => this._hostService.reload(), e => this._notificationService.error(e)))]
}
});
if (enablementState === EnablementState.DisabledByTrustRequirement || enablementState === EnablementState.DisabledByVirtualWorkspace) {
this._notificationService.notify({
severity: Severity.Error,
message: localize('notSupportedInWorkspace', "Cannot activate the '{0}' extension because it depends on the '{1}' extension which is not supported in the current workspace", extName, missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name),
});
} else if (this._extensionEnablementService.canChangeEnablement(missingInstalledDependency)) {
this._notificationService.notify({
severity: Severity.Error,
message: localize('disabledDep', "Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled. Would you like to enable the extension and reload the window?", extName, missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name),
actions: {
primary: [new Action('enable', localize('enable dep', "Enable and Reload"), '', true,
() => this._extensionEnablementService.setEnablement([missingInstalledDependency], enablementState === EnablementState.DisabledGlobally ? EnablementState.EnabledGlobally : EnablementState.EnabledWorkspace)
.then(() => this._hostService.reload(), e => this._notificationService.error(e)))]
}
});
} else {
this._notificationService.notify({
severity: Severity.Error,
message: localize('disabledDepNoAction', "Cannot activate the '{0}' extension because it depends on the '{1}' extension which is disabled.", extName, missingInstalledDependency.manifest.displayName || missingInstalledDependency.manifest.name),
});
}
}
}