diff --git a/src/EditorFeatures/TestUtilities/Remote/InProcRemostHostClient.cs b/src/EditorFeatures/TestUtilities/Remote/InProcRemostHostClient.cs index ecaac6fe6a7a393bd4932d7024f3b175fdc4bde2..57b08c15712f450567f4b5a405c3868595a6ee42 100644 --- a/src/EditorFeatures/TestUtilities/Remote/InProcRemostHostClient.cs +++ b/src/EditorFeatures/TestUtilities/Remote/InProcRemostHostClient.cs @@ -72,7 +72,7 @@ public static async Task CreateAsync(Workspace workspace, bool // this is what consumer actually use to communicate information var serviceStream = await _inprocServices.RequestServiceAsync(serviceName, cancellationToken).ConfigureAwait(false); - return new ServiceHubJsonRpcConnection(callbackTarget, serviceStream, _remotableDataRpc.Share(), cancellationToken); + return new JsonRpcConnection(callbackTarget, serviceStream, _remotableDataRpc.Share(), cancellationToken); } protected override void OnStarted() diff --git a/src/VisualStudio/Core/Next/Remote/JsonRpcConnection.cs b/src/VisualStudio/Core/Next/Remote/JsonRpcConnection.cs index 353413390cdc23c6338955df7a58f72e9bfb331b..28f9d30c0bf9016af526e192e2f1933688364bf9 100644 --- a/src/VisualStudio/Core/Next/Remote/JsonRpcConnection.cs +++ b/src/VisualStudio/Core/Next/Remote/JsonRpcConnection.cs @@ -10,10 +10,10 @@ namespace Microsoft.VisualStudio.LanguageServices.Remote { - internal class ServiceHubJsonRpcConnection : RemoteHostClient.Connection + internal class JsonRpcConnection : RemoteHostClient.Connection { // communication channel related to service information - private readonly ServiceJsonRpcClient _serviceClient; + private readonly ServiceJsonRpcEx _serviceRpc; // communication channel related to snapshot information private readonly RemotableDataJsonRpcEx _remoteDataRpc; @@ -21,14 +21,14 @@ internal class ServiceHubJsonRpcConnection : RemoteHostClient.Connection // close connection when cancellation has raised private readonly CancellationTokenRegistration _cancellationRegistration; - public ServiceHubJsonRpcConnection( + public JsonRpcConnection( object callbackTarget, Stream serviceStream, RemotableDataJsonRpcEx dataRpc, CancellationToken cancellationToken) : base(cancellationToken) { - _serviceClient = new ServiceJsonRpcClient(serviceStream, callbackTarget, cancellationToken); + _serviceRpc = new ServiceJsonRpcEx(serviceStream, callbackTarget, cancellationToken); _remoteDataRpc = dataRpc; // dispose session when cancellation has raised @@ -37,27 +37,27 @@ internal class ServiceHubJsonRpcConnection : RemoteHostClient.Connection protected override async Task OnRegisterPinnedRemotableDataScopeAsync(PinnedRemotableDataScope scope) { - await _serviceClient.InvokeAsync(WellKnownServiceHubServices.ServiceHubServiceBase_Initialize, scope.SolutionInfo).ConfigureAwait(false); + await _serviceRpc.InvokeAsync(WellKnownServiceHubServices.ServiceHubServiceBase_Initialize, scope.SolutionInfo).ConfigureAwait(false); } public override Task InvokeAsync(string targetName, params object[] arguments) { - return _serviceClient.InvokeAsync(targetName, arguments); + return _serviceRpc.InvokeAsync(targetName, arguments); } public override Task InvokeAsync(string targetName, params object[] arguments) { - return _serviceClient.InvokeAsync(targetName, arguments); + return _serviceRpc.InvokeAsync(targetName, arguments); } public override Task InvokeAsync(string targetName, IEnumerable arguments, Func funcWithDirectStreamAsync) { - return _serviceClient.InvokeAsync(targetName, arguments, funcWithDirectStreamAsync); + return _serviceRpc.InvokeAsync(targetName, arguments, funcWithDirectStreamAsync); } public override Task InvokeAsync(string targetName, IEnumerable arguments, Func> funcWithDirectStreamAsync) { - return _serviceClient.InvokeAsync(targetName, arguments, funcWithDirectStreamAsync); + return _serviceRpc.InvokeAsync(targetName, arguments, funcWithDirectStreamAsync); } protected override void OnDisposed() @@ -68,7 +68,7 @@ protected override void OnDisposed() _cancellationRegistration.Dispose(); // dispose service and snapshot channels - _serviceClient.Dispose(); + _serviceRpc.Dispose(); _remoteDataRpc.Dispose(); } @@ -77,11 +77,11 @@ protected override void OnDisposed() /// /// this is the channel consumer of remote host client will playing with /// - private class ServiceJsonRpcClient : JsonRpcEx + private class ServiceJsonRpcEx : JsonRpcEx { private readonly object _callbackTarget; - public ServiceJsonRpcClient(Stream stream, object callbackTarget, CancellationToken cancellationToken) + public ServiceJsonRpcEx(Stream stream, object callbackTarget, CancellationToken cancellationToken) : base(stream, callbackTarget, useThisAsCallback: false, cancellationToken: cancellationToken) { // this one doesn't need cancellation token since it has nothing to cancel diff --git a/src/VisualStudio/Core/Next/Remote/ServiceHubRemoteHostClient.cs b/src/VisualStudio/Core/Next/Remote/ServiceHubRemoteHostClient.cs index e4c05616bd130c549006693f440be4bcf558b3dc..1d411f8f4a2f978d15c989e5280ed12d6198c2bb 100644 --- a/src/VisualStudio/Core/Next/Remote/ServiceHubRemoteHostClient.cs +++ b/src/VisualStudio/Core/Next/Remote/ServiceHubRemoteHostClient.cs @@ -127,7 +127,7 @@ public override async Task TryCreateConnectionAsync(string serviceNa // this is what consumer actually use to communicate information var serviceStream = await RequestServiceAsync(_hubClient, serviceName, _hostGroup, _timeout, cancellationToken).ConfigureAwait(false); - return new ServiceHubJsonRpcConnection(callbackTarget, serviceStream, _remotableDataRpc.Share(), cancellationToken); + return new JsonRpcConnection(callbackTarget, serviceStream, _remotableDataRpc.Share(), cancellationToken); } protected override void OnStarted()