Skip to content

Commit 9654a4d

Browse files
Remove feature option from DevNext (#77816)
followup to #77806
2 parents 0833b6d + 3a9c0a4 commit 9654a4d

File tree

7 files changed

+6
-37
lines changed

7 files changed

+6
-37
lines changed

src/EditorFeatures/Test/Options/GlobalOptionsTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ static void Recurse(Type type, object options, object defaultOptions, string? la
123123
// Skip validation of ReloadChangedAnalyzerReferences. The test options store returns 'true'
124124
// for 'null' (which the option uses to mean 'try the feature flag'). Which is also equivalent
125125
// to the default for this option.
126-
if (IsStoredInGlobalOptions(property, language) &&
127-
property.Name != nameof(WorkspaceConfigurationOptions.ReloadChangedAnalyzerReferences))
126+
if (IsStoredInGlobalOptions(property, language))
128127
{
129128
Assert.False(Equals(value, defaultValue), $"{type.FullName}.{property.Name} not initialized from global options");
130129
}

src/LanguageServer/Protocol/Features/Options/WorkspaceConfigurationOptionsStorage.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ internal static class WorkspaceConfigurationOptionsStorage
1111
public static WorkspaceConfigurationOptions GetWorkspaceConfigurationOptions(this IGlobalOptionService globalOptions)
1212
=> new(
1313
SourceGeneratorExecution: globalOptions.GetOption(SourceGeneratorExecution),
14-
ReloadChangedAnalyzerReferences:
15-
globalOptions.GetOption(ReloadChangedAnalyzerReferences),
1614
ValidateCompilationTrackerStates: globalOptions.GetOption(ValidateCompilationTrackerStates));
1715

1816
public static readonly Option2<bool> ValidateCompilationTrackerStates = new(
@@ -25,8 +23,4 @@ public static WorkspaceConfigurationOptions GetWorkspaceConfigurationOptions(thi
2523
serializer: new EditorConfigValueSerializer<SourceGeneratorExecutionPreference>(
2624
s => SourceGeneratorExecutionPreferenceUtilities.Parse(s, SourceGeneratorExecutionPreference.Balanced),
2725
SourceGeneratorExecutionPreferenceUtilities.GetEditorConfigString));
28-
29-
public static readonly Option2<bool> ReloadChangedAnalyzerReferences = new(
30-
"dotnet_reload_changed_analyzer_references",
31-
defaultValue: true);
3226
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@ public bool TryFetch(LocalUserRegistryOptionPersister persister, OptionKey2 opti
417417
{"visual_studio_navigate_to_object_browser", new RoamingProfileStorage("TextEditor.%LANGUAGE%.Specific.NavigateToObjectBrowser")},
418418
{"dotnet_validate_compilation_tracker_states", new FeatureFlagStorage(@"Roslyn.ValidateCompilationTrackerStates")},
419419
{"dotnet_source_generator_execution", new RoamingProfileStorage("TextEditor.Roslyn.Specific.SourceGeneratorExecution")},
420-
{"dotnet_reload_changed_analyzer_references", new LocalUserProfileStorage(@"Roslyn\Internal\OnOff\Features", "DotnetReloadChangedAnalyzerReferences")},
421420
{"xaml_enable_lsp_intellisense", new FeatureFlagStorage(@"Xaml.EnableLspIntelliSense")},
422421
};
423422
}

src/Workspaces/Core/Portable/Workspace/IWorkspaceConfigurationService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ internal sealed class DefaultWorkspaceConfigurationService() : IWorkspaceConfigu
3434
[DataContract]
3535
internal sealed record class WorkspaceConfigurationOptions(
3636
[property: DataMember(Order = 0)] SourceGeneratorExecutionPreference SourceGeneratorExecution = SourceGeneratorExecutionPreference.Automatic,
37-
[property: DataMember(Order = 1)] bool ReloadChangedAnalyzerReferences = true,
38-
[property: DataMember(Order = 2)] bool ValidateCompilationTrackerStates =
37+
[property: DataMember(Order = 1)] bool ValidateCompilationTrackerStates =
3938
#if DEBUG // We will default this on in DEBUG builds
4039
true
4140
#else

src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.Core.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,6 @@ public static async partial ValueTask<ImmutableArray<AnalyzerReference>> CreateI
200200
SolutionServices solutionServices,
201201
CancellationToken cancellationToken)
202202
{
203-
// Fallback to stock behavior if the reloading option is disabled.
204-
var optionsService = solutionServices.GetRequiredService<IWorkspaceConfigurationService>();
205-
if (!optionsService.Options.ReloadChangedAnalyzerReferences)
206-
return await DefaultCreateIsolatedAnalyzerReferencesAsync(references).ConfigureAwait(false);
207-
208203
if (references.Length == 0)
209204
return [];
210205

@@ -226,11 +221,6 @@ public static async partial ValueTask<ImmutableArray<AnalyzerReference>> CreateI
226221
Func<Task<ImmutableArray<AnalyzerReference>>> getReferencesAsync,
227222
CancellationToken cancellationToken)
228223
{
229-
// Fallback to stock behavior if the reloading option is disabled.
230-
var optionsService = solutionServices.GetRequiredService<IWorkspaceConfigurationService>();
231-
if (!optionsService.Options.ReloadChangedAnalyzerReferences)
232-
return await DefaultCreateIsolatedAnalyzerReferencesAsync(getReferencesAsync).ConfigureAwait(false);
233-
234224
if (analyzerChecksums.Children.Length == 0)
235225
return [];
236226

src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.Desktop.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
#if !NET
66

77
using System;
8-
using System.Collections.Generic;
98
using System.Collections.Immutable;
109
using System.Threading;
1110
using System.Threading.Tasks;
1211
using Microsoft.CodeAnalysis.Diagnostics;
1312
using Microsoft.CodeAnalysis.Host;
1413
using Microsoft.CodeAnalysis.Serialization;
14+
using Roslyn.Utilities;
1515

1616
namespace Microsoft.CodeAnalysis;
1717

@@ -27,17 +27,17 @@ public static partial ValueTask<ImmutableArray<AnalyzerReference>> CreateIsolate
2727
SolutionServices solutionServices,
2828
CancellationToken cancellationToken)
2929
{
30-
return DefaultCreateIsolatedAnalyzerReferencesAsync(references);
30+
return ValueTaskFactory.FromResult(references);
3131
}
3232

33-
public static partial ValueTask<ImmutableArray<AnalyzerReference>> CreateIsolatedAnalyzerReferencesAsync(
33+
public static async partial ValueTask<ImmutableArray<AnalyzerReference>> CreateIsolatedAnalyzerReferencesAsync(
3434
bool useAsync,
3535
ChecksumCollection analyzerChecksums,
3636
SolutionServices solutionServices,
3737
Func<Task<ImmutableArray<AnalyzerReference>>> getReferencesAsync,
3838
CancellationToken cancellationToken)
3939
{
40-
return DefaultCreateIsolatedAnalyzerReferencesAsync(getReferencesAsync);
40+
return await getReferencesAsync().ConfigureAwait(false);
4141
}
4242
}
4343

src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,6 @@ public static partial ValueTask<ImmutableArray<AnalyzerReference>> CreateIsolate
3939
Func<Task<ImmutableArray<AnalyzerReference>>> getReferencesAsync,
4040
CancellationToken cancellationToken);
4141

42-
private static ValueTask<ImmutableArray<AnalyzerReference>> DefaultCreateIsolatedAnalyzerReferencesAsync(
43-
ImmutableArray<AnalyzerReference> references)
44-
{
45-
return ValueTaskFactory.FromResult(references);
46-
}
47-
48-
private static async ValueTask<ImmutableArray<AnalyzerReference>> DefaultCreateIsolatedAnalyzerReferencesAsync(
49-
Func<Task<ImmutableArray<AnalyzerReference>>> getReferencesAsync)
50-
{
51-
return await getReferencesAsync().ConfigureAwait(false);
52-
}
53-
5442
public static Guid TryGetFileReferenceMvid(string filePath)
5543
{
5644
try

0 commit comments

Comments
 (0)