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

Fix ServiceHub Core host option #57223

Merged
merged 1 commit into from
Oct 20, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal UnitTestingRemoteHostClient(ServiceHubRemoteHostClient client, UnitTest
public static bool IsServiceHubProcessCoreClr(HostWorkspaceServices services)
{
var optionServices = services.GetRequiredService<IOptionService>();
return optionServices.GetOption(RemoteHostOptions.OOPCoreClr) || optionServices.GetOption(RemoteHostOptions.OOPCoreClrFeatureFlag);
return optionServices.GetOption(RemoteHostOptions.OOPCoreClrFeatureFlag);
}

public UnitTestingRemoteServiceConnectionWrapper<TService> CreateConnection<TService>(object? callbackTarget) where TService : class
Expand Down
11 changes: 3 additions & 8 deletions src/Workspaces/Remote/Core/RemoteHostOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,15 @@ internal sealed class RemoteHostOptions : IOptionProvider
new FeatureFlagStorageLocation("Roslyn.OOPServerGC"));

// use coreclr host for OOP
public static readonly Option2<bool> OOPCoreClr = new(
FeatureName, nameof(OOPCoreClr), defaultValue: false,
storageLocation: new LocalUserProfileStorageLocation(LocalRegistryPath + nameof(OOPCoreClr)));

public static readonly Option<bool> OOPCoreClrFeatureFlag = new(
FeatureName, nameof(OOPCoreClr), defaultValue: false,
new FeatureFlagStorageLocation("Roslyn.OOPCoreClr"));
Copy link
Member Author

Choose a reason for hiding this comment

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

Change the experiment name to match an existing targeted notification

FeatureName, nameof(OOPCoreClrFeatureFlag), defaultValue: false,
new FeatureFlagStorageLocation("Roslyn.ServiceHubCore"));

ImmutableArray<IOption> IOptionProvider.Options { get; } = ImmutableArray.Create<IOption>(
SolutionChecksumMonitorBackOffTimeSpanInMS,
OOP64Bit,
OOPServerGC,
OOPServerGCFeatureFlag,
OOPCoreClr,
OOPCoreClrFeatureFlag);

[ImportingConstructor]
Expand All @@ -77,7 +72,7 @@ public static bool IsUsingServiceHubOutOfProcess(IGlobalOptionService globalOpti
=> Environment.Is64BitOperatingSystem && globalOptions.GetOption(OOP64Bit);

public static bool IsServiceHubProcessCoreClr(IGlobalOptionService globalOptions)
=> globalOptions.GetOption(OOPCoreClr) || globalOptions.GetOption(OOPCoreClrFeatureFlag);
=> globalOptions.GetOption(OOPCoreClrFeatureFlag);

public static bool IsCurrentProcessRunningOnCoreClr()
=> !RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework") &&
Expand Down