@@ -79,9 +79,9 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi
79
79
@IFileService private readonly fileService : IFileService ,
80
80
@IProductService productService : IProductService ,
81
81
@IUriIdentityService uriIdentityService : IUriIdentityService ,
82
- @IUserDataProfilesService private readonly userDataProfilesService : IUserDataProfilesService ,
82
+ @IUserDataProfilesService userDataProfilesService : IUserDataProfilesService ,
83
83
) {
84
- super ( galleryService , telemetryService , logService , productService ) ;
84
+ super ( galleryService , telemetryService , logService , productService , userDataProfilesService ) ;
85
85
const extensionLifecycle = this . _register ( instantiationService . createInstance ( ExtensionsLifecycle ) ) ;
86
86
this . extensionsScanner = this . _register ( instantiationService . createInstance ( ExtensionsScanner , extension => extensionLifecycle . postUninstall ( extension ) ) ) ;
87
87
this . manifestCache = this . _register ( new ExtensionsManifestCache ( environmentService , this ) ) ;
@@ -178,7 +178,7 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi
178
178
return downloadedLocation ;
179
179
}
180
180
181
- protected createInstallExtensionTask ( manifest : IExtensionManifest , extension : URI | IGalleryExtension , options : ServerInstallOptions & ServerInstallVSIXOptions ) : IInstallExtensionTask {
181
+ protected doCreateInstallExtensionTask ( manifest : IExtensionManifest , extension : URI | IGalleryExtension , options : ServerInstallOptions & ServerInstallVSIXOptions ) : IInstallExtensionTask {
182
182
let installExtensionTask : IInstallExtensionTask | undefined ;
183
183
if ( URI . isUri ( extension ) ) {
184
184
installExtensionTask = new InstallVSIXTask ( manifest , extension , options , this . galleryService , this . extensionsScanner , this . logService ) ;
@@ -190,15 +190,15 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi
190
190
installExtensionTask . waitUntilTaskIsFinished ( ) . then ( ( ) => this . installGalleryExtensionsTasks . delete ( key ) ) ;
191
191
}
192
192
}
193
- if ( options . profileLocation && this . userDataProfilesService . defaultProfile . extensionsResource ) {
194
- return new InstallExtensionInProfileTask ( installExtensionTask , options . profileLocation , this . userDataProfilesService . defaultProfile . extensionsResource , this . extensionsProfileScannerService ) ;
193
+ if ( options . profileLocation ) {
194
+ return new InstallExtensionInProfileTask ( installExtensionTask , options . profileLocation , this . extensionsProfileScannerService ) ;
195
195
}
196
196
return installExtensionTask ;
197
197
}
198
198
199
- protected createUninstallExtensionTask ( extension : ILocalExtension , options : ServerUninstallOptions ) : IUninstallExtensionTask {
200
- if ( options . profileLocation && this . userDataProfilesService . defaultProfile . extensionsResource ) {
201
- return new UninstallExtensionFromProfileTask ( extension , options . profileLocation , this . userDataProfilesService , this . extensionsProfileScannerService ) ;
199
+ protected doCreateUninstallExtensionTask ( extension : ILocalExtension , options : ServerUninstallOptions ) : IUninstallExtensionTask {
200
+ if ( options . profileLocation ) {
201
+ return new UninstallExtensionFromProfileTask ( extension , options . profileLocation , this . extensionsProfileScannerService ) ;
202
202
}
203
203
return new UninstallExtensionTask ( extension , options , this . extensionsScanner ) ;
204
204
}
@@ -735,17 +735,15 @@ class InstallExtensionInProfileTask implements IInstallExtensionTask {
735
735
736
736
constructor (
737
737
private readonly task : IInstallExtensionTask ,
738
- readonly profileLocation : URI ,
739
- private readonly defaultProfileLocation : URI ,
738
+ private readonly profileLocation : URI ,
740
739
private readonly extensionsProfileScannerService : IExtensionsProfileScannerService ,
741
740
) {
742
741
this . promise = this . waitAndAddExtensionToProfile ( ) ;
743
742
}
744
743
745
744
private async waitAndAddExtensionToProfile ( ) : Promise < { local : ILocalExtension ; metadata : Metadata } > {
746
745
const result = await this . task . waitUntilTaskIsFinished ( ) ;
747
- const profileLocation = result . local . isApplicationScoped ? this . defaultProfileLocation : this . profileLocation ;
748
- await this . extensionsProfileScannerService . addExtensionsToProfile ( [ [ result . local , result . metadata ] ] , profileLocation ) ;
746
+ await this . extensionsProfileScannerService . addExtensionsToProfile ( [ [ result . local , result . metadata ] ] , this . profileLocation ) ;
749
747
return result ;
750
748
}
751
749
@@ -808,19 +806,13 @@ class UninstallExtensionFromProfileTask extends AbstractExtensionTask<void> impl
808
806
constructor (
809
807
readonly extension : ILocalExtension ,
810
808
private readonly profileLocation : URI ,
811
- private readonly userDataProfilesService : IUserDataProfilesService ,
812
809
private readonly extensionsProfileScannerService : IExtensionsProfileScannerService ,
813
810
) {
814
811
super ( ) ;
815
812
}
816
813
817
814
protected async doRun ( token : CancellationToken ) : Promise < void > {
818
- const promises : Promise < any > [ ] = [ ] ;
819
- promises . push ( this . extensionsProfileScannerService . removeExtensionFromProfile ( this . extension . identifier , this . profileLocation ) ) ;
820
- if ( this . extension . isApplicationScoped && this . userDataProfilesService . defaultProfile . extensionsResource ) {
821
- promises . push ( this . extensionsProfileScannerService . removeExtensionFromProfile ( this . extension . identifier , this . userDataProfilesService . defaultProfile . extensionsResource ) ) ;
822
- }
823
- await Promise . all ( promises ) ;
815
+ await this . extensionsProfileScannerService . removeExtensionFromProfile ( this . extension . identifier , this . profileLocation ) ;
824
816
}
825
817
826
818
}
0 commit comments