From fd2370e89239e29af34d84b74ccdf8f7006cbfda Mon Sep 17 00:00:00 2001 From: Heejae Chang Date: Tue, 20 Jun 2017 14:40:26 -0700 Subject: [PATCH] some more rename --- .../Remote/InProcRemostHostClient.cs | 2 +- .../Core/Next/Remote/JsonRpcConnection.cs | 24 +++++++++---------- .../Next/Remote/ServiceHubRemoteHostClient.cs | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/EditorFeatures/TestUtilities/Remote/InProcRemostHostClient.cs b/src/EditorFeatures/TestUtilities/Remote/InProcRemostHostClient.cs index ecaac6fe6a7..57b08c15712 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 353413390cd..28f9d30c0bf 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 e4c05616bd1..1d411f8f4a2 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() -- GitLab