@@ -28,7 +28,8 @@ export class RemoteExtensionsScannerService implements IRemoteExtensionsScannerS
28
28
29
29
readonly _serviceBrand : undefined ;
30
30
31
- private readonly _whenExtensionsReady : Promise < void > ;
31
+ private readonly _whenBuiltinExtensionsReady = Promise . resolve ( ) ;
32
+ private readonly _whenExtensionsReady = Promise . resolve ( ) ;
32
33
33
34
constructor (
34
35
private readonly _extensionManagementCLI : ExtensionManagementCLI ,
@@ -44,21 +45,19 @@ export class RemoteExtensionsScannerService implements IRemoteExtensionsScannerS
44
45
_logService . trace ( 'Installing builtin extensions passed via args...' ) ;
45
46
const installOptions : InstallOptions = { isMachineScoped : ! ! environmentService . args [ 'do-not-sync' ] , installPreReleaseVersion : ! ! environmentService . args [ 'pre-release' ] } ;
46
47
performance . mark ( 'code/server/willInstallBuiltinExtensions' ) ;
47
- this . _whenExtensionsReady = _extensionManagementCLI . installExtensions ( [ ] , this . _asExtensionIdOrVSIX ( builtinExtensionsToInstall ) , installOptions , ! ! environmentService . args [ 'force' ] )
48
+ this . _whenExtensionsReady = this . _whenBuiltinExtensionsReady = _extensionManagementCLI . installExtensions ( [ ] , this . _asExtensionIdOrVSIX ( builtinExtensionsToInstall ) , installOptions , ! ! environmentService . args [ 'force' ] )
48
49
. then ( ( ) => {
49
50
performance . mark ( 'code/server/didInstallBuiltinExtensions' ) ;
50
51
_logService . trace ( 'Finished installing builtin extensions' ) ;
51
52
} , error => {
52
53
_logService . error ( error ) ;
53
54
} ) ;
54
- } else {
55
- this . _whenExtensionsReady = Promise . resolve ( ) ;
56
55
}
57
56
58
57
const extensionsToInstall = environmentService . args [ 'install-extension' ] ;
59
58
if ( extensionsToInstall ) {
60
59
_logService . trace ( 'Installing extensions passed via args...' ) ;
61
- this . _whenExtensionsReady
60
+ this . _whenExtensionsReady = this . _whenBuiltinExtensionsReady
62
61
. then ( ( ) => _extensionManagementCLI . installExtensions ( this . _asExtensionIdOrVSIX ( extensionsToInstall ) , [ ] , {
63
62
isMachineScoped : ! ! environmentService . args [ 'do-not-sync' ] ,
64
63
installPreReleaseVersion : ! ! environmentService . args [ 'pre-release' ] ,
@@ -84,7 +83,7 @@ export class RemoteExtensionsScannerService implements IRemoteExtensionsScannerS
84
83
performance . mark ( 'code/server/willScanExtensions' ) ;
85
84
this . _logService . trace ( `Scanning extensions using UI language: ${ language } ` ) ;
86
85
87
- await this . whenExtensionsReady ( ) ;
86
+ await this . _whenBuiltinExtensionsReady ;
88
87
89
88
const extensionDevelopmentPaths = extensionDevelopmentLocations ? extensionDevelopmentLocations . filter ( url => url . scheme === Schemas . file ) . map ( url => url . fsPath ) : undefined ;
90
89
profileLocation = profileLocation ?? this . _userDataProfilesService . defaultProfile . extensionsResource ;
@@ -99,7 +98,7 @@ export class RemoteExtensionsScannerService implements IRemoteExtensionsScannerS
99
98
}
100
99
101
100
async scanSingleExtension ( extensionLocation : URI , isBuiltin : boolean , language ?: string ) : Promise < IExtensionDescription | null > {
102
- await this . whenExtensionsReady ( ) ;
101
+ await this . _whenBuiltinExtensionsReady ;
103
102
104
103
const extensionPath = extensionLocation . scheme === Schemas . file ? extensionLocation . fsPath : null ;
105
104
0 commit comments