@@ -9,7 +9,7 @@ import { getMachineId } from 'vs/base/node/id';
9
9
import { ClientConnectionEvent , IPCServer , IServerChannel , ProxyChannel } from 'vs/base/parts/ipc/common/ipc' ;
10
10
import { LogsDataCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner' ;
11
11
import { main } from 'vs/code/node/cliProcessMain' ;
12
- import { Query , VscodeOptions , WorkbenchOptions } from 'vs/ipc' ;
12
+ import { Query , SocketOptions , VscodeOptions , WorkbenchOptions } from 'vs/ipc' ;
13
13
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
14
14
import { ConfigurationService } from 'vs/platform/configuration/common/configurationService' ;
15
15
import { ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc' ;
@@ -46,6 +46,7 @@ import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogA
46
46
import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService' ;
47
47
import { combinedAppender , NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils' ;
48
48
import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender' ;
49
+ import { PtyHostService } from 'vs/platform/terminal/node/ptyHostService' ;
49
50
import { TelemetryChannel } from 'vs/server/common/telemetry' ;
50
51
import { ExtensionEnvironmentChannel , FileProviderChannel , TerminalProviderChannel } from 'vs/server/node/channel' ;
51
52
import { Connection , ExtensionHostConnection , ManagementConnection } from 'vs/server/node/connection' ;
@@ -57,7 +58,6 @@ import { getUriTransformer } from 'vs/server/node/util';
57
58
import { REMOTE_TERMINAL_CHANNEL_NAME } from 'vs/workbench/contrib/terminal/common/remoteTerminalChannel' ;
58
59
import { REMOTE_FILE_SYSTEM_CHANNEL_NAME } from 'vs/workbench/services/remote/common/remoteAgentFileSystemChannel' ;
59
60
import { RemoteExtensionLogFileName } from 'vs/workbench/services/remote/common/remoteAgentService' ;
60
- import { PtyHostService } from 'vs/platform/terminal/node/ptyHostService' ;
61
61
62
62
const commit = product . commit || 'development' ;
63
63
@@ -79,7 +79,7 @@ export class Vscode {
79
79
public async initialize ( options : VscodeOptions ) : Promise < WorkbenchOptions > {
80
80
const transformer = getUriTransformer ( options . remoteAuthority ) ;
81
81
if ( ! this . servicesPromise ) {
82
- this . servicesPromise = this . initializeServices ( options . args ) ;
82
+ this . servicesPromise = this . initializeServices ( options ) ;
83
83
}
84
84
await this . servicesPromise ;
85
85
const environment = this . services . get ( IEnvironmentService ) as INativeEnvironmentService ;
@@ -116,25 +116,25 @@ export class Vscode {
116
116
} ;
117
117
}
118
118
119
- public async handleWebSocket ( socket : net . Socket , query : Query , permessageDeflate : boolean ) : Promise < true > {
119
+ public async handleWebSocket ( socket : net . Socket , query : Query , options : SocketOptions ) : Promise < true > {
120
120
if ( ! query . reconnectionToken ) {
121
121
throw new Error ( 'Reconnection token is missing from query parameters' ) ;
122
122
}
123
123
const protocol = new Protocol ( socket , {
124
124
reconnectionToken : < string > query . reconnectionToken ,
125
125
reconnection : query . reconnection === 'true' ,
126
126
skipWebSocketFrames : query . skipWebSocketFrames === 'true' ,
127
- permessageDeflate,
127
+ permessageDeflate : options . permessageDeflate ,
128
128
} ) ;
129
129
try {
130
- await this . connect ( await protocol . handshake ( ) , protocol ) ;
130
+ await this . connect ( await protocol . handshake ( ) , protocol , options . proxyUri ) ;
131
131
} catch ( error ) {
132
132
protocol . destroy ( error . message ) ;
133
133
}
134
134
return true ;
135
135
}
136
136
137
- private async connect ( message : ConnectionTypeRequest , protocol : Protocol ) : Promise < void > {
137
+ private async connect ( message : ConnectionTypeRequest , protocol : Protocol , proxyUri : string ) : Promise < void > {
138
138
if ( product . commit && message . commit !== product . commit ) {
139
139
logger . warn ( `Version mismatch (${ message . commit } instead of ${ product . commit } )` ) ;
140
140
}
@@ -185,6 +185,7 @@ export class Vscode {
185
185
...message . args ,
186
186
} ,
187
187
this . services . get ( IEnvironmentService ) as INativeEnvironmentService ,
188
+ proxyUri ,
188
189
) ;
189
190
}
190
191
connections . set ( token , connection ) ;
@@ -211,9 +212,9 @@ export class Vscode {
211
212
// References:
212
213
// ../../electron-browser/sharedProcess/sharedProcessMain.ts#L148
213
214
// ../../../code/electron-main/app.ts
214
- private async initializeServices ( args : NativeParsedArgs ) : Promise < void > {
215
+ private async initializeServices ( options : VscodeOptions ) : Promise < void > {
215
216
const productService = { _serviceBrand : undefined , ...product } ;
216
- const environmentService = new NativeEnvironmentService ( args , productService ) ;
217
+ const environmentService = new NativeEnvironmentService ( options . args , productService ) ;
217
218
218
219
await Promise . all ( [
219
220
environmentService . extensionsPath ,
0 commit comments