未验证 提交 a5ae0043 编写于 作者: M msftbot[bot] 提交者: GitHub

Merge pull request #41620 from dotnet/merges/release/dev16.5-to-master

Merge release/dev16.5 to master
......@@ -14,6 +14,7 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Remote;
using Microsoft.CodeAnalysis.Remote.Services;
using Microsoft.CodeAnalysis.Test.Utilities.RemoteHost;
using Microsoft.VisualStudio.LanguageServices.Remote;
using Nerdbank;
using Roslyn.Utilities;
......@@ -90,6 +91,7 @@ public Task<Stream> RequestServiceAsync(string serviceName)
}
public override string ClientId { get; }
public override bool IsRemoteHost64Bit => IntPtr.Size == 8;
public override async Task<Connection?> TryCreateConnectionAsync(
string serviceName, object? callbackTarget, CancellationToken cancellationToken)
......
......@@ -190,11 +190,7 @@ bool IRemoteHostClientService.IsEnabled()
private void SetRemoteHostBitness()
{
var x64 = _workspace.Options.GetOption(RemoteHostOptions.OOP64Bit);
if (!x64)
{
x64 = _workspace.Services.GetRequiredService<IExperimentationService>().IsExperimentEnabled(WellKnownExperimentNames.RoslynOOP64bit);
}
bool x64 = RemoteHostOptions.IsServiceHubProcess64Bit(_workspace);
// log OOP bitness
Logger.Log(FunctionId.RemoteHost_Bitness, KeyValueLogMessage.Create(LogType.Trace, m => m["64bit"] = x64));
......
......@@ -4,7 +4,9 @@
using System.Collections.Immutable;
using System.Composition;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Editor.Shared.Options;
using Microsoft.CodeAnalysis.Experiments;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Options.Providers;
......@@ -53,6 +55,10 @@ internal static class RemoteHostOptions
public static readonly Option<int> MaxPoolConnection = new Option<int>(
nameof(InternalFeatureOnOffOptions), nameof(MaxPoolConnection), defaultValue: 15,
storageLocations: new LocalUserProfileStorageLocation(InternalFeatureOnOffOptions.LocalRegistryPath + nameof(MaxPoolConnection)));
public static bool IsServiceHubProcess64Bit(Workspace workspace)
=> workspace.Options.GetOption(OOP64Bit) ||
workspace.Services.GetRequiredService<IExperimentationService>().IsExperimentEnabled(WellKnownExperimentNames.RoslynOOP64bit);
}
[ExportOptionProvider, Shared]
......
......@@ -160,6 +160,7 @@ static bool ReportNonFatalWatson(Exception e, CancellationToken cancellationToke
}
public override string ClientId => _connectionManager.HostGroup.Id;
public override bool IsRemoteHost64Bit => RemoteHostOptions.IsServiceHubProcess64Bit(Workspace);
public override Task<Connection?> TryCreateConnectionAsync(string serviceName, object? callbackTarget, CancellationToken cancellationToken)
{
......
......@@ -22,6 +22,11 @@ public static async Task<Optional<T>> TryRunRemoteAsync<T>(Workspace workspace,
return default;
}
if (client.IsRemoteHost64Bit)
{
serviceName += "64";
}
using var connection = await client.TryCreateConnectionAsync(serviceName, callbackTarget: null, cancellationToken).ConfigureAwait(false);
if (connection == null)
{
......
......@@ -52,6 +52,8 @@ protected RemoteHostClient(Workspace workspace)
/// </summary>
public abstract Task<Connection?> TryCreateConnectionAsync(string serviceName, object? callbackTarget, CancellationToken cancellationToken);
public abstract bool IsRemoteHost64Bit { get; }
protected abstract void OnStarted();
protected void Started()
......@@ -196,6 +198,7 @@ public NoOpClient(Workspace workspace)
}
public override string ClientId => nameof(NoOpClient);
public override bool IsRemoteHost64Bit => false;
public override Task<Connection?> TryCreateConnectionAsync(string serviceName, object? callbackTarget, CancellationToken cancellationToken)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册