Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused parts of RemoteHostClient #73466

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions src/Workspaces/Core/Portable/Remote/RemoteHostClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,7 @@ namespace Microsoft.CodeAnalysis.Remote;
/// </summary>
internal abstract class RemoteHostClient : IDisposable
{
public event EventHandler<bool>? StatusChanged;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no one was subscribed to this event. so i removed it entirely. simplifying things from there.


protected void Started()
{
OnStatusChanged(started: true);
}

public virtual void Dispose()
=> OnStatusChanged(started: false);

private void OnStatusChanged(bool started)
=> StatusChanged?.Invoke(this, started);
public abstract void Dispose();

public static Task<RemoteHostClient?> TryGetClientAsync(Project project, CancellationToken cancellationToken)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public static RemoteHostClient Create(SolutionServices services, RemoteServiceCa
var inprocServices = new InProcRemoteServices(services, traceListener, testData);
var instance = new InProcRemoteHostClient(services, inprocServices, callbackDispatchers);

instance.Started();

// return instance
return instance;
}
Expand Down Expand Up @@ -76,8 +74,6 @@ public override RemoteServiceConnection<T> CreateConnection<T>(object? callbackT
public override void Dispose()
{
_inprocServices.Dispose();

base.Dispose();
}

public sealed class ServiceProvider : IServiceProvider
Expand Down
3 changes: 0 additions & 3 deletions src/Workspaces/Remote/Core/ServiceHubRemoteHostClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ await client.TryInvokeAsync<IRemoteAsynchronousOperationListenerService>(
(service, cancellationToken) => service.EnableAsync(AsynchronousOperationListenerProvider.IsEnabled, listenerProvider.DiagnosticTokensEnabled, cancellationToken),
cancellationToken).ConfigureAwait(false);

client.Started();
return client;
}
}
Expand Down Expand Up @@ -141,8 +140,6 @@ public override void Dispose()
_hubClient.Dispose();

_serviceBrokerClient.Dispose();

base.Dispose();
}
}
}
Loading