@@ -10,7 +10,7 @@ import { IWindowsMainService } from 'vs/code/electron-main/windows';
1010import { VSCodeWindow } from 'vs/code/electron-main/window' ;
1111import { TPromise } from 'vs/base/common/winjs.base' ;
1212import { IChannel } from 'vs/base/parts/ipc/common/ipc' ;
13- import { ILogService } from 'vs/code/electron-main /log' ;
13+ import { ILogService } from 'vs/code/common /log' ;
1414import { IURLService } from 'vs/platform/url/common/url' ;
1515import { IProcessEnvironment } from 'vs/base/common/platform' ;
1616import { ParsedArgs } from 'vs/platform/environment/common/environment' ;
@@ -41,7 +41,7 @@ export class LaunchChannel implements ILaunchChannel {
4141
4242 constructor ( private service : ILaunchService ) { }
4343
44- call ( command : string , arg : any ) : TPromise < any > {
44+ public call ( command : string , arg : any ) : TPromise < any > {
4545 switch ( command ) {
4646 case 'start' :
4747 const { args, userEnv } = arg as IStartArguments ;
@@ -50,6 +50,7 @@ export class LaunchChannel implements ILaunchChannel {
5050 case 'get-main-process-id' :
5151 return this . service . getMainProcessId ( ) ;
5252 }
53+
5354 return undefined ;
5455 }
5556}
@@ -60,11 +61,11 @@ export class LaunchChannelClient implements ILaunchService {
6061
6162 constructor ( private channel : ILaunchChannel ) { }
6263
63- start ( args : ParsedArgs , userEnv : IProcessEnvironment ) : TPromise < void > {
64+ public start ( args : ParsedArgs , userEnv : IProcessEnvironment ) : TPromise < void > {
6465 return this . channel . call ( 'start' , { args, userEnv } ) ;
6566 }
6667
67- getMainProcessId ( ) : TPromise < number > {
68+ public getMainProcessId ( ) : TPromise < number > {
6869 return this . channel . call ( 'get-main-process-id' , null ) ;
6970 }
7071}
@@ -79,19 +80,20 @@ export class LaunchService implements ILaunchService {
7980 @IURLService private urlService : IURLService
8081 ) { }
8182
82- start ( args : ParsedArgs , userEnv : IProcessEnvironment ) : TPromise < void > {
83+ public start ( args : ParsedArgs , userEnv : IProcessEnvironment ) : TPromise < void > {
8384 this . logService . log ( 'Received data from other instance: ' , args , userEnv ) ;
8485
86+ // Check early for open-url which is handled in URL service
8587 const openUrlArg = args [ 'open-url' ] || [ ] ;
8688 const openUrl = typeof openUrlArg === 'string' ? [ openUrlArg ] : openUrlArg ;
87- const context = ! ! userEnv [ 'VSCODE_CLI' ] ? OpenContext . CLI : OpenContext . DESKTOP ;
88-
8989 if ( openUrl . length > 0 ) {
9090 openUrl . forEach ( url => this . urlService . open ( url ) ) ;
91+
9192 return TPromise . as ( null ) ;
9293 }
9394
9495 // Otherwise handle in windows service
96+ const context = ! ! userEnv [ 'VSCODE_CLI' ] ? OpenContext . CLI : OpenContext . DESKTOP ;
9597 let usedWindows : VSCodeWindow [ ] ;
9698 if ( ! ! args . extensionDevelopmentPath ) {
9799 this . windowsService . openExtensionDevelopmentHostWindow ( { context, cli : args , userEnv } ) ;
@@ -129,8 +131,9 @@ export class LaunchService implements ILaunchService {
129131 return TPromise . as ( null ) ;
130132 }
131133
132- getMainProcessId ( ) : TPromise < number > {
134+ public getMainProcessId ( ) : TPromise < number > {
133135 this . logService . log ( 'Received request for process ID from other instance.' ) ;
136+
134137 return TPromise . as ( process . pid ) ;
135138 }
136139}
0 commit comments