@@ -40,6 +40,7 @@ import { IProductService } from 'vs/platform/product/common/productService';
40
40
import { validateExtensionManifest } from 'vs/platform/extensions/common/extensionValidator' ;
41
41
import Severity from 'vs/base/common/severity' ;
42
42
import { IStringDictionary } from 'vs/base/common/collections' ;
43
+ import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile' ;
43
44
44
45
type GalleryExtensionInfo = { readonly id : string ; preRelease ?: boolean ; migrateStorageFrom ?: string } ;
45
46
type ExtensionInfo = { readonly id : string ; preRelease : boolean } ;
@@ -83,7 +84,6 @@ export class WebExtensionsScannerService extends Disposable implements IWebExten
83
84
84
85
private readonly systemExtensionsCacheResource : URI | undefined = undefined ;
85
86
private readonly customBuiltinExtensionsCacheResource : URI | undefined = undefined ;
86
- private readonly installedExtensionsResource : URI | undefined = undefined ;
87
87
private readonly resourcesAccessQueueMap = new ResourceMap < Queue < IWebExtension [ ] > > ( ) ;
88
88
89
89
constructor (
@@ -97,11 +97,11 @@ export class WebExtensionsScannerService extends Disposable implements IWebExten
97
97
@IExtensionStorageService private readonly extensionStorageService : IExtensionStorageService ,
98
98
@IStorageService private readonly storageService : IStorageService ,
99
99
@IProductService private readonly productService : IProductService ,
100
+ @IUserDataProfileService private readonly userDataProfileService : IUserDataProfileService ,
100
101
@ILifecycleService lifecycleService : ILifecycleService ,
101
102
) {
102
103
super ( ) ;
103
104
if ( isWeb ) {
104
- this . installedExtensionsResource = joinPath ( environmentService . userRoamingDataHome , 'extensions.json' ) ;
105
105
this . systemExtensionsCacheResource = joinPath ( environmentService . userRoamingDataHome , 'systemExtensionsCache.json' ) ;
106
106
this . customBuiltinExtensionsCacheResource = joinPath ( environmentService . userRoamingDataHome , 'customBuiltinExtensionsCache.json' ) ;
107
107
this . registerActions ( ) ;
@@ -672,15 +672,15 @@ export class WebExtensionsScannerService extends Disposable implements IWebExten
672
672
673
673
private async readInstalledExtensions ( ) : Promise < IWebExtension [ ] > {
674
674
await this . migratePackageNLSUris ( ) ;
675
- return this . withWebExtensions ( this . installedExtensionsResource ) ;
675
+ return this . withWebExtensions ( this . userDataProfileService . currentProfile . extensionsResource ) ;
676
676
}
677
677
678
678
// TODO: @TylerLeonhardt /@Sandy 081: Delete after 6 months
679
679
private _migratePackageNLSUrisPromise : Promise < void > | undefined ;
680
680
private migratePackageNLSUris ( ) : Promise < void > {
681
681
if ( ! this . _migratePackageNLSUrisPromise ) {
682
682
this . _migratePackageNLSUrisPromise = ( async ( ) => {
683
- const webExtensions = await this . withWebExtensions ( this . installedExtensionsResource ) ;
683
+ const webExtensions = await this . withWebExtensions ( this . userDataProfileService . currentProfile . extensionsResource ) ;
684
684
if ( webExtensions . some ( e => ! e . packageNLSUris && e . packageNLSUri ) ) {
685
685
const migratedExtensions = await Promise . all ( webExtensions . map ( async e => {
686
686
if ( ! e . packageNLSUris && e . packageNLSUri ) {
@@ -691,15 +691,15 @@ export class WebExtensionsScannerService extends Disposable implements IWebExten
691
691
}
692
692
return e ;
693
693
} ) ) ;
694
- await this . withWebExtensions ( this . installedExtensionsResource , ( ) => migratedExtensions ) ;
694
+ await this . withWebExtensions ( this . userDataProfileService . currentProfile . extensionsResource , ( ) => migratedExtensions ) ;
695
695
}
696
696
} ) ( ) ;
697
697
}
698
698
return this . _migratePackageNLSUrisPromise ;
699
699
}
700
700
701
701
private writeInstalledExtensions ( updateFn : ( extensions : IWebExtension [ ] ) => IWebExtension [ ] ) : Promise < IWebExtension [ ] > {
702
- return this . withWebExtensions ( this . installedExtensionsResource , updateFn ) ;
702
+ return this . withWebExtensions ( this . userDataProfileService . currentProfile . extensionsResource , updateFn ) ;
703
703
}
704
704
705
705
private readCustomBuiltinExtensionsCache ( ) : Promise < IWebExtension [ ] > {
@@ -809,7 +809,7 @@ export class WebExtensionsScannerService extends Disposable implements IWebExten
809
809
} ) ;
810
810
}
811
811
run ( serviceAccessor : ServicesAccessor ) : void {
812
- serviceAccessor . get ( IEditorService ) . openEditor ( { resource : that . installedExtensionsResource } ) ;
812
+ serviceAccessor . get ( IEditorService ) . openEditor ( { resource : that . userDataProfileService . currentProfile . extensionsResource } ) ;
813
813
}
814
814
} ) ) ;
815
815
}
0 commit comments