@@ -61,7 +61,7 @@ import { ExtensionEnvironmentChannel, FileProviderChannel, NodeProxyService } fr
6161import { Connection , ExtensionHostConnection , ManagementConnection } from "vs/server/src/node/connection" ;
6262import { TelemetryClient } from "vs/server/src/node/insights" ;
6363import { getLocaleFromConfig , getNlsConfiguration } from "vs/server/src/node/nls" ;
64- import { NodeProxyChannel } from "vs/server/src/common/nodeProxy" ;
64+ import { NodeProxyChannel , INodeProxyService } from "vs/server/src/common/nodeProxy" ;
6565import { Protocol } from "vs/server/src/node/protocol" ;
6666import { TelemetryChannel } from "vs/server/src/common/telemetry" ;
6767import { UpdateService } from "vs/server/src/node/update" ;
@@ -621,6 +621,11 @@ export class MainServer extends Server {
621621 this . _onDidClientConnect . fire ( {
622622 protocol, onDidClientDisconnect : connection . onClose ,
623623 } ) ;
624+ // NOTE: We can do this because we only have one connection at a
625+ // time but if that changes we need a way to determine which clients
626+ // belong to a connection and dispose only those.
627+ ( this . services . get ( INodeProxyService ) as NodeProxyService ) . _onUp . fire ( ) ;
628+ connection . onClose ( ( ) => ( this . services . get ( INodeProxyService ) as NodeProxyService ) . _onDown . fire ( ) ) ;
624629 } else {
625630 const buffer = protocol . readEntireBuffer ( ) ;
626631 connection = new ExtensionHostConnection (
@@ -695,6 +700,8 @@ export class MainServer extends Server {
695700 const instantiationService = new InstantiationService ( this . services ) ;
696701 const localizationService = instantiationService . createInstance ( LocalizationsService ) ;
697702 this . services . set ( ILocalizationsService , localizationService ) ;
703+ const proxyService = instantiationService . createInstance ( NodeProxyService ) ;
704+ this . services . set ( INodeProxyService , proxyService ) ;
698705 this . ipc . registerChannel ( "localizations" , new LocalizationsChannel ( localizationService ) ) ;
699706 instantiationService . invokeFunction ( ( ) => {
700707 instantiationService . createInstance ( LogsDataCleaner ) ;
@@ -708,7 +715,7 @@ export class MainServer extends Server {
708715 const requestChannel = new RequestChannel ( this . services . get ( IRequestService ) as IRequestService ) ;
709716 const telemetryChannel = new TelemetryChannel ( telemetryService ) ;
710717 const updateChannel = new UpdateChannel ( instantiationService . createInstance ( UpdateService ) ) ;
711- const nodeProxyChannel = new NodeProxyChannel ( instantiationService . createInstance ( NodeProxyService ) ) ;
718+ const nodeProxyChannel = new NodeProxyChannel ( proxyService ) ;
712719
713720 this . ipc . registerChannel ( "extensions" , extensionsChannel ) ;
714721 this . ipc . registerChannel ( "remoteextensionsenvironment" , extensionsEnvironmentChannel ) ;
0 commit comments