Skip to content

Commit 71ea819

Browse files
Merge pull request #72689 from CyrusNajmabadi/removeOptionFlag
Remove feature flag option
2 parents 585518b + dbf3750 commit 71ea819

File tree

3 files changed

+15
-49
lines changed

3 files changed

+15
-49
lines changed

src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs

-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ public bool TryFetch(LocalUserRegistryOptionPersister persister, OptionKey2 opti
426426
{"visual_basic_style_unused_value_assignment_preference", new RoamingProfileStorage("TextEditor.VisualBasic.Specific.UnusedValueAssignmentPreference")},
427427
{"visual_basic_style_unused_value_expression_statement_preference", new RoamingProfileStorage("TextEditor.VisualBasic.Specific.UnusedValueExpressionStatementPreference")},
428428
{"visual_studio_navigate_to_object_browser", new RoamingProfileStorage("TextEditor.%LANGUAGE%.Specific.NavigateToObjectBrowser")},
429-
{"visual_studio_workspace_partial_load_mode", new FeatureFlagStorage(@"Roslyn.PartialLoadMode")},
430429
{"dotnet_disable_recoverable_text", new FeatureFlagStorage(@"Roslyn.DisableRecoverableText")},
431430
{"dotnet_validate_compilation_tracker_states", new FeatureFlagStorage(@"Roslyn.ValidateCompilationTrackerStates")},
432431
{"dotnet_enable_diagnostics_in_source_generated_files", new RoamingProfileStorage("TextEditor.Roslyn.Specific.EnableDiagnosticsInSourceGeneratedFilesExperiment")},

src/VisualStudio/Core/Def/Workspace/VisualStudioWorkspaceStatusServiceFactory.cs

+12-39
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
using Microsoft.CodeAnalysis.Host;
1111
using Microsoft.CodeAnalysis.Host.Mef;
1212
using Microsoft.CodeAnalysis.Internal.Log;
13-
using Microsoft.CodeAnalysis.Options;
1413
using Microsoft.CodeAnalysis.Shared.TestHooks;
1514
using Microsoft.ServiceHub.Framework;
1615
using Microsoft.VisualStudio.OperationProgress;
@@ -23,55 +22,29 @@
2322
namespace Microsoft.VisualStudio.LanguageServices.Implementation;
2423

2524
[ExportWorkspaceServiceFactory(typeof(IWorkspaceStatusService), ServiceLayer.Host), Shared]
26-
internal sealed class VisualStudioWorkspaceStatusServiceFactory : IWorkspaceServiceFactory
25+
[method: ImportingConstructor]
26+
[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
27+
internal sealed class VisualStudioWorkspaceStatusServiceFactory(
28+
SVsServiceProvider serviceProvider,
29+
IThreadingContext threadingContext,
30+
IAsynchronousOperationListenerProvider listenerProvider) : IWorkspaceServiceFactory
2731
{
28-
private static readonly Option2<bool> s_partialLoadModeFeatureFlag = new("visual_studio_workspace_partial_load_mode", defaultValue: false);
29-
30-
private readonly IAsyncServiceProvider2 _serviceProvider;
31-
private readonly IThreadingContext _threadingContext;
32-
private readonly IGlobalOptionService _globalOptions;
33-
private readonly IAsynchronousOperationListener _listener;
34-
35-
[ImportingConstructor]
36-
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
37-
public VisualStudioWorkspaceStatusServiceFactory(
38-
SVsServiceProvider serviceProvider,
39-
IThreadingContext threadingContext,
40-
IGlobalOptionService globalOptions,
41-
IAsynchronousOperationListenerProvider listenerProvider)
42-
{
43-
_serviceProvider = (IAsyncServiceProvider2)serviceProvider;
44-
_threadingContext = threadingContext;
45-
_globalOptions = globalOptions;
46-
47-
// for now, we use workspace so existing tests can automatically wait for full solution load event
48-
// subscription done in test
49-
_listener = listenerProvider.GetListener(FeatureAttribute.Workspace);
50-
}
32+
private readonly IAsyncServiceProvider2 _serviceProvider = (IAsyncServiceProvider2)serviceProvider;
33+
private readonly IAsynchronousOperationListener _listener = listenerProvider.GetListener(FeatureAttribute.Workspace);
5134

5235
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
5336
public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
5437
{
55-
if (workspaceServices.Workspace is VisualStudioWorkspace)
56-
{
57-
if (!_globalOptions.GetOption(s_partialLoadModeFeatureFlag))
58-
{
59-
// don't enable partial load mode for ones that are not in experiment yet
60-
return new WorkspaceStatusService();
61-
}
62-
63-
// only VSWorkspace supports partial load mode
64-
return new Service(_serviceProvider, _threadingContext, _listener);
65-
}
66-
67-
return new WorkspaceStatusService();
38+
return workspaceServices.Workspace is VisualStudioWorkspace
39+
? new Service(_serviceProvider, threadingContext, _listener)
40+
: new DefaultWorkspaceStatusService();
6841
}
6942

7043
/// <summary>
7144
/// for prototype, we won't care about what solution is actually fully loaded.
7245
/// we will just see whatever solution VS has at this point of time has actually fully loaded
7346
/// </summary>
74-
private class Service : IWorkspaceStatusService
47+
private sealed class Service : IWorkspaceStatusService
7548
{
7649
private readonly IAsyncServiceProvider2 _serviceProvider;
7750
private readonly IThreadingContext _threadingContext;

src/Workspaces/Core/Portable/Workspace/Host/Status/WorkspaceStatusService.cs src/Workspaces/Core/Portable/Workspace/Host/Status/DefaultWorkspaceStatusService.cs

+3-9
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#nullable disable
6-
75
using System;
86
using System.Composition;
97
using System.Threading;
@@ -14,14 +12,10 @@
1412
namespace Microsoft.CodeAnalysis.Host;
1513

1614
[ExportWorkspaceService(typeof(IWorkspaceStatusService), ServiceLayer.Default), Shared]
17-
internal sealed class WorkspaceStatusService : IWorkspaceStatusService
15+
[method: ImportingConstructor]
16+
[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
17+
internal sealed class DefaultWorkspaceStatusService() : IWorkspaceStatusService
1818
{
19-
[ImportingConstructor]
20-
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
21-
public WorkspaceStatusService()
22-
{
23-
}
24-
2519
event EventHandler IWorkspaceStatusService.StatusChanged
2620
{
2721
add { }

0 commit comments

Comments
 (0)