public async Task <Connection> ActivateAsync(CancellationToken cancellationToken) { var client = await RemoteHostClient.TryGetClientAsync(_workspace, cancellationToken).ConfigureAwait(false); if (client == null) { // There is no OOP. either user turned it off, or process got killed. // We should have already gotten a gold bar + nfw already if the OOP is missing. // so just log telemetry here so we can connect the two with session explorer. Logger.Log(FunctionId.LanguageServer_ActivateFailed, KeyValueLogMessage.NoProperty); return(null); } var hostGroup = new HostGroup(client.ClientId); var hubClient = new HubClient(ServiceHubClientName); var stream = await ServiceHubRemoteHostClient.RequestServiceAsync( _workspace, hubClient, WellKnownServiceHubServices.LanguageServer, hostGroup, cancellationToken).ConfigureAwait(false); return(new Connection(stream, stream)); }
public async Task <Connection> ActivateAsync(CancellationToken cancellationToken) { var client = await RemoteHostClient.TryGetClientAsync(_workspace, cancellationToken).ConfigureAwait(false); if (client == null) { // there is no OOP. either user turned it off, or process got killed. return(null); } var hostGroup = new HostGroup(client.ClientId); var hubClient = new HubClient(ServiceHubClientName); var stream = await ServiceHubRemoteHostClient.RequestServiceAsync( _workspace, hubClient, WellKnownServiceHubServices.LanguageServer, hostGroup, cancellationToken).ConfigureAwait(false); return(new Connection(stream, stream)); }