33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6- import { IChannel , IServerChannel } from 'vs/base/parts/ipc/common/ipc' ;
76import { ILogService } from 'vs/platform/log/common/log' ;
87import { IURLService } from 'vs/platform/url/common/url' ;
98import { IProcessEnvironment , isMacintosh } from 'vs/base/common/platform' ;
@@ -16,7 +15,6 @@ import { IWorkspacesMainService } from 'vs/platform/workspaces/electron-main/wor
1615import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
1716import { URI } from 'vs/base/common/uri' ;
1817import { BrowserWindow , ipcMain , Event as IpcEvent , app } from 'electron' ;
19- import { Event } from 'vs/base/common/event' ;
2018import { coalesce } from 'vs/base/common/arrays' ;
2119import { IDiagnosticInfoOptions , IDiagnosticInfo , IRemoteDiagnosticInfo , IRemoteDiagnosticError } from 'vs/platform/diagnostics/common/diagnostics' ;
2220import { IMainProcessInfo , IWindowInfo } from 'vs/platform/launch/common/launch' ;
@@ -60,64 +58,6 @@ export interface ILaunchMainService {
6058 getRemoteDiagnostics ( options : IRemoteDiagnosticOptions ) : Promise < ( IRemoteDiagnosticInfo | IRemoteDiagnosticError ) [ ] > ;
6159}
6260
63- export class LaunchChannel implements IServerChannel {
64-
65- constructor ( private service : ILaunchMainService ) { }
66-
67- listen < T > ( _ : unknown , event : string ) : Event < T > {
68- throw new Error ( `Event not found: ${ event } ` ) ;
69- }
70-
71- call ( _ : unknown , command : string , arg : any ) : Promise < any > {
72- switch ( command ) {
73- case 'start' :
74- const { args, userEnv } = arg as IStartArguments ;
75- return this . service . start ( args , userEnv ) ;
76-
77- case 'get-main-process-id' :
78- return this . service . getMainProcessId ( ) ;
79-
80- case 'get-main-process-info' :
81- return this . service . getMainProcessInfo ( ) ;
82-
83- case 'get-logs-path' :
84- return this . service . getLogsPath ( ) ;
85-
86- case 'get-remote-diagnostics' :
87- return this . service . getRemoteDiagnostics ( arg ) ;
88- }
89-
90- throw new Error ( `Call not found: ${ command } ` ) ;
91- }
92- }
93-
94- export class LaunchChannelClient implements ILaunchMainService {
95-
96- _serviceBrand : undefined ;
97-
98- constructor ( private channel : IChannel ) { }
99-
100- start ( args : ParsedArgs , userEnv : IProcessEnvironment ) : Promise < void > {
101- return this . channel . call ( 'start' , { args, userEnv } ) ;
102- }
103-
104- getMainProcessId ( ) : Promise < number > {
105- return this . channel . call ( 'get-main-process-id' , null ) ;
106- }
107-
108- getMainProcessInfo ( ) : Promise < IMainProcessInfo > {
109- return this . channel . call ( 'get-main-process-info' , null ) ;
110- }
111-
112- getLogsPath ( ) : Promise < string > {
113- return this . channel . call ( 'get-logs-path' , null ) ;
114- }
115-
116- getRemoteDiagnostics ( options : IRemoteDiagnosticOptions ) : Promise < IRemoteDiagnosticInfo [ ] > {
117- return this . channel . call ( 'get-remote-diagnostics' , options ) ;
118- }
119- }
120-
12161export class LaunchMainService implements ILaunchMainService {
12262
12363 _serviceBrand : undefined ;
0 commit comments