@@ -106,6 +106,8 @@ class ExpectedError extends Error {
106106
107107function setupIPC ( accessor : ServicesAccessor ) : Promise < Server > {
108108 const logService = accessor . get ( ILogService ) ;
109+ const environmentService = accessor . get ( IEnvironmentService ) ;
110+ const instantiationService = accessor . get ( IInstantiationService ) ;
109111
110112 function allowSetForegroundWindow ( service : LaunchChannelClient ) : Promise < void > {
111113 let promise : Promise < void > = Promise . resolve ( ) ;
@@ -127,8 +129,6 @@ function setupIPC(accessor: ServicesAccessor): Promise<Server> {
127129 }
128130
129131 function setup ( retry : boolean ) : Promise < Server > {
130- const environmentService = accessor . get ( IEnvironmentService ) ;
131-
132132 return serve ( environmentService . mainIPCHandle ) . then ( server => {
133133
134134 // Print --status usage info
@@ -195,14 +195,18 @@ function setupIPC(accessor: ServicesAccessor): Promise<Server> {
195195 // Process Info
196196 if ( environmentService . args . status ) {
197197 return service . getMainProcessInfo ( ) . then ( info => {
198- return accessor . get ( IDiagnosticsService ) . printDiagnostics ( info ) . then ( ( ) => Promise . reject ( new ExpectedError ( ) ) ) ;
198+ return instantiationService . invokeFunction ( accessor => {
199+ return accessor . get ( IDiagnosticsService ) . printDiagnostics ( info ) . then ( ( ) => Promise . reject ( new ExpectedError ( ) ) ) ;
200+ } ) ;
199201 } ) ;
200202 }
201203
202204 // Log uploader
203205 if ( typeof environmentService . args [ 'upload-logs' ] !== 'undefined' ) {
204- return uploadLogs ( service , accessor . get ( IRequestService ) , environmentService )
205- . then ( ( ) => Promise . reject ( new ExpectedError ( ) ) ) ;
206+ return instantiationService . invokeFunction ( accessor => {
207+ return uploadLogs ( service , accessor . get ( IRequestService ) , environmentService )
208+ . then ( ( ) => Promise . reject ( new ExpectedError ( ) ) ) ;
209+ } ) ;
206210 }
207211
208212 logService . trace ( 'Sending env to running instance...' ) ;
0 commit comments