@@ -8,12 +8,13 @@ import { INotificationService, Severity } from 'vs/platform/notification/common/
88import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
99import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
1010import { localize } from 'vs/nls' ;
11- import { InstallRecommendedExtensionAction , ShowRecommendedExtensionsAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions' ;
11+ import { InstallRecommendedExtensionAction , ShowRecommendedExtensionAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions' ;
1212import { ExtensionRecommendationSource , IExtensionRecommendationReson } from 'vs/workbench/services/extensionManagement/common/extensionManagement' ;
1313import { IExtensionsConfiguration , ConfigurationKey } from 'vs/workbench/contrib/extensions/common/extensions' ;
1414import { IConfigurationService , ConfigurationTarget } from 'vs/platform/configuration/common/configuration' ;
1515import { IStorageService , StorageScope } from 'vs/platform/storage/common/storage' ;
1616import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys' ;
17+ import { IAction } from 'vs/base/common/actions' ;
1718
1819type ExtensionRecommendationsNotificationClassification = {
1920 userReaction : { classification : 'SystemMetaData' , purpose : 'FeatureInsight' } ;
@@ -56,22 +57,27 @@ export abstract class ExtensionRecommendations extends Disposable {
5657 return this . _activationPromise ;
5758 }
5859
60+ private runAction ( action : IAction ) {
61+ try {
62+ action . run ( ) ;
63+ } finally {
64+ action . dispose ( ) ;
65+ }
66+ }
67+
5968 protected promptImportantExtensionInstallNotification ( extensionId : string , message : string ) : void {
6069 this . notificationService . prompt ( Severity . Info , message ,
6170 [ {
6271 label : localize ( 'install' , 'Install' ) ,
6372 run : ( ) => {
6473 this . telemetryService . publicLog2 < { userReaction : string , extensionId : string } , ExtensionRecommendationsNotificationClassification > ( 'extensionRecommendations:popup' , { userReaction : 'install' , extensionId } ) ;
65- this . instantiationService . createInstance ( InstallRecommendedExtensionAction , extensionId ) . run ( ) ;
74+ this . runAction ( this . instantiationService . createInstance ( InstallRecommendedExtensionAction , extensionId ) ) ;
6675 }
6776 } , {
68- label : localize ( 'showRecommendations ' , "Show Recommendations " ) ,
77+ label : localize ( 'moreInformation ' , "More Information " ) ,
6978 run : ( ) => {
7079 this . telemetryService . publicLog2 < { userReaction : string , extensionId : string } , ExtensionRecommendationsNotificationClassification > ( 'extensionRecommendations:popup' , { userReaction : 'show' , extensionId } ) ;
71-
72- const recommendationsAction = this . instantiationService . createInstance ( ShowRecommendedExtensionsAction , ShowRecommendedExtensionsAction . ID , localize ( 'showRecommendations' , "Show Recommendations" ) ) ;
73- recommendationsAction . run ( ) ;
74- recommendationsAction . dispose ( ) ;
80+ this . runAction ( this . instantiationService . createInstance ( ShowRecommendedExtensionAction , extensionId ) ) ;
7581 }
7682 } , {
7783 label : choiceNever ,
0 commit comments