@@ -9,6 +9,7 @@ import { URI } from 'vs/base/common/uri';
9
9
import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService' ;
10
10
import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService' ;
11
11
import { IFileService } from 'vs/platform/files/common/files' ;
12
+ import { ILogService } from 'vs/platform/log/common/log' ;
12
13
import { EXTENSIONS_RESOURCE_NAME } from 'vs/platform/userDataProfile/common/userDataProfile' ;
13
14
import { IUserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile' ;
14
15
@@ -18,18 +19,23 @@ export class DefaultExtensionsProfileInitHandler extends Disposable {
18
19
@IFileService private readonly fileService : IFileService ,
19
20
@IExtensionsScannerService private readonly extensionsScannerService : IExtensionsScannerService ,
20
21
@IExtensionsProfileScannerService private readonly extensionsProfileScannerService : IExtensionsProfileScannerService ,
22
+ @ILogService logService : ILogService ,
21
23
) {
22
24
super ( ) ;
23
- this . _register ( userDataProfilesService . onWillCreateProfile ( e => {
24
- if ( userDataProfilesService . profiles . length === 1 ) {
25
- e . join ( this . initialize ( ) ) ;
26
- }
27
- } ) ) ;
28
- this . _register ( userDataProfilesService . onDidChangeProfiles ( e => {
29
- if ( userDataProfilesService . profiles . length === 1 ) {
30
- this . uninitialize ( ) ;
31
- }
32
- } ) ) ;
25
+ if ( userDataProfilesService . isEnabled ( ) ) {
26
+ this . _register ( userDataProfilesService . onWillCreateProfile ( e => {
27
+ if ( userDataProfilesService . profiles . length === 1 ) {
28
+ e . join ( this . initialize ( ) ) ;
29
+ }
30
+ } ) ) ;
31
+ this . _register ( userDataProfilesService . onDidChangeProfiles ( e => {
32
+ if ( userDataProfilesService . profiles . length === 1 ) {
33
+ this . uninitialize ( ) ;
34
+ }
35
+ } ) ) ;
36
+ } else {
37
+ this . uninitialize ( ) . then ( null , e => logService . error ( e ) ) ;
38
+ }
33
39
}
34
40
35
41
private async initialize ( ) : Promise < void > {
0 commit comments