@@ -95,6 +95,7 @@ class CodeMain {
9595 await instantiationService . invokeFunction ( async accessor => {
9696 const environmentService = accessor . get ( IEnvironmentService ) ;
9797 const stateService = accessor . get ( IStateService ) ;
98+ const logService = accessor . get ( ILogService ) ;
9899
99100 // Patch `process.env` with the instance's environment
100101 const instanceEnvironment = this . patchEnvironment ( environmentService ) ;
@@ -110,7 +111,7 @@ class CodeMain {
110111 throw error ;
111112 }
112113
113- const mainIpcServer = await instantiationService . invokeFunction ( accessor => this . doStartup ( accessor , true ) ) ;
114+ const mainIpcServer = await this . doStartup ( logService , environmentService , instantiationService , true ) ;
114115 bufferLogService . logger = new SpdLogService ( 'main' , environmentService . logsPath , bufferLogService . getLevel ( ) ) ;
115116
116117 return instantiationService . createInstance ( CodeApplication , mainIpcServer , instanceEnvironment ) . startup ( ) ;
@@ -174,10 +175,7 @@ class CodeMain {
174175 return instanceEnvironment ;
175176 }
176177
177- private async doStartup ( accessor : ServicesAccessor , retry : boolean ) : Promise < Server > {
178- const logService = accessor . get ( ILogService ) ;
179- const environmentService = accessor . get ( IEnvironmentService ) ;
180- const instantiationService = accessor . get ( IInstantiationService ) ;
178+ private async doStartup ( logService : ILogService , environmentService : IEnvironmentService , instantiationService : IInstantiationService , retry : boolean ) : Promise < Server > {
181179
182180 // Try to setup a server for running. If that succeeds it means
183181 // we are the first instance to startup. Otherwise it is likely
@@ -231,7 +229,7 @@ class CodeMain {
231229 throw error ;
232230 }
233231
234- return this . doStartup ( accessor , false ) ;
232+ return this . doStartup ( logService , environmentService , instantiationService , false ) ;
235233 }
236234
237235 // Tests from CLI require to be the only instance currently
0 commit comments