diff --git a/src/EditorFeatures/Test/Options/GlobalOptionsTests.cs b/src/EditorFeatures/Test/Options/GlobalOptionsTests.cs index e66278ff95d2d..bd55bf95924be 100644 --- a/src/EditorFeatures/Test/Options/GlobalOptionsTests.cs +++ b/src/EditorFeatures/Test/Options/GlobalOptionsTests.cs @@ -123,8 +123,7 @@ static void Recurse(Type type, object options, object defaultOptions, string? la // Skip validation of ReloadChangedAnalyzerReferences. The test options store returns 'true' // for 'null' (which the option uses to mean 'try the feature flag'). Which is also equivalent // to the default for this option. - if (IsStoredInGlobalOptions(property, language) && - property.Name != nameof(WorkspaceConfigurationOptions.ReloadChangedAnalyzerReferences)) + if (IsStoredInGlobalOptions(property, language)) { Assert.False(Equals(value, defaultValue), $"{type.FullName}.{property.Name} not initialized from global options"); } diff --git a/src/LanguageServer/Protocol/Features/Options/WorkspaceConfigurationOptionsStorage.cs b/src/LanguageServer/Protocol/Features/Options/WorkspaceConfigurationOptionsStorage.cs index 3bd2969d8a013..4ee817268a4b5 100644 --- a/src/LanguageServer/Protocol/Features/Options/WorkspaceConfigurationOptionsStorage.cs +++ b/src/LanguageServer/Protocol/Features/Options/WorkspaceConfigurationOptionsStorage.cs @@ -11,8 +11,6 @@ internal static class WorkspaceConfigurationOptionsStorage public static WorkspaceConfigurationOptions GetWorkspaceConfigurationOptions(this IGlobalOptionService globalOptions) => new( SourceGeneratorExecution: globalOptions.GetOption(SourceGeneratorExecution), - ReloadChangedAnalyzerReferences: - globalOptions.GetOption(ReloadChangedAnalyzerReferences), ValidateCompilationTrackerStates: globalOptions.GetOption(ValidateCompilationTrackerStates)); public static readonly Option2 ValidateCompilationTrackerStates = new( @@ -25,8 +23,4 @@ public static WorkspaceConfigurationOptions GetWorkspaceConfigurationOptions(thi serializer: new EditorConfigValueSerializer( s => SourceGeneratorExecutionPreferenceUtilities.Parse(s, SourceGeneratorExecutionPreference.Balanced), SourceGeneratorExecutionPreferenceUtilities.GetEditorConfigString)); - - public static readonly Option2 ReloadChangedAnalyzerReferences = new( - "dotnet_reload_changed_analyzer_references", - defaultValue: true); } diff --git a/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs b/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs index bf66d74e0f091..bf6719c76366f 100644 --- a/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs +++ b/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs @@ -417,7 +417,6 @@ public bool TryFetch(LocalUserRegistryOptionPersister persister, OptionKey2 opti {"visual_studio_navigate_to_object_browser", new RoamingProfileStorage("TextEditor.%LANGUAGE%.Specific.NavigateToObjectBrowser")}, {"dotnet_validate_compilation_tracker_states", new FeatureFlagStorage(@"Roslyn.ValidateCompilationTrackerStates")}, {"dotnet_source_generator_execution", new RoamingProfileStorage("TextEditor.Roslyn.Specific.SourceGeneratorExecution")}, - {"dotnet_reload_changed_analyzer_references", new LocalUserProfileStorage(@"Roslyn\Internal\OnOff\Features", "DotnetReloadChangedAnalyzerReferences")}, {"xaml_enable_lsp_intellisense", new FeatureFlagStorage(@"Xaml.EnableLspIntelliSense")}, }; } diff --git a/src/Workspaces/Core/Portable/Workspace/IWorkspaceConfigurationService.cs b/src/Workspaces/Core/Portable/Workspace/IWorkspaceConfigurationService.cs index 0915bd7fddf39..f493478033fce 100644 --- a/src/Workspaces/Core/Portable/Workspace/IWorkspaceConfigurationService.cs +++ b/src/Workspaces/Core/Portable/Workspace/IWorkspaceConfigurationService.cs @@ -34,8 +34,7 @@ internal sealed class DefaultWorkspaceConfigurationService() : IWorkspaceConfigu [DataContract] internal sealed record class WorkspaceConfigurationOptions( [property: DataMember(Order = 0)] SourceGeneratorExecutionPreference SourceGeneratorExecution = SourceGeneratorExecutionPreference.Automatic, - [property: DataMember(Order = 1)] bool ReloadChangedAnalyzerReferences = true, - [property: DataMember(Order = 2)] bool ValidateCompilationTrackerStates = + [property: DataMember(Order = 1)] bool ValidateCompilationTrackerStates = #if DEBUG // We will default this on in DEBUG builds true #else diff --git a/src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.Core.cs b/src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.Core.cs index b013c9736ed04..2592d94422eb8 100644 --- a/src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.Core.cs +++ b/src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.Core.cs @@ -200,11 +200,6 @@ public static async partial ValueTask> CreateI SolutionServices solutionServices, CancellationToken cancellationToken) { - // Fallback to stock behavior if the reloading option is disabled. - var optionsService = solutionServices.GetRequiredService(); - if (!optionsService.Options.ReloadChangedAnalyzerReferences) - return await DefaultCreateIsolatedAnalyzerReferencesAsync(references).ConfigureAwait(false); - if (references.Length == 0) return []; @@ -226,11 +221,6 @@ public static async partial ValueTask> CreateI Func>> getReferencesAsync, CancellationToken cancellationToken) { - // Fallback to stock behavior if the reloading option is disabled. - var optionsService = solutionServices.GetRequiredService(); - if (!optionsService.Options.ReloadChangedAnalyzerReferences) - return await DefaultCreateIsolatedAnalyzerReferencesAsync(getReferencesAsync).ConfigureAwait(false); - if (analyzerChecksums.Children.Length == 0) return []; diff --git a/src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.Desktop.cs b/src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.Desktop.cs index 06505901c4213..c37ad98b42d90 100644 --- a/src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.Desktop.cs +++ b/src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.Desktop.cs @@ -5,13 +5,13 @@ #if !NET using System; -using System.Collections.Generic; using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Serialization; +using Roslyn.Utilities; namespace Microsoft.CodeAnalysis; @@ -27,17 +27,17 @@ public static partial ValueTask> CreateIsolate SolutionServices solutionServices, CancellationToken cancellationToken) { - return DefaultCreateIsolatedAnalyzerReferencesAsync(references); + return ValueTaskFactory.FromResult(references); } - public static partial ValueTask> CreateIsolatedAnalyzerReferencesAsync( + public static async partial ValueTask> CreateIsolatedAnalyzerReferencesAsync( bool useAsync, ChecksumCollection analyzerChecksums, SolutionServices solutionServices, Func>> getReferencesAsync, CancellationToken cancellationToken) { - return DefaultCreateIsolatedAnalyzerReferencesAsync(getReferencesAsync); + return await getReferencesAsync().ConfigureAwait(false); } } diff --git a/src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.cs b/src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.cs index dc661417bc6c9..0bfddee093d9f 100644 --- a/src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.cs +++ b/src/Workspaces/Core/Portable/Workspace/IsolatedAnalyzerReferenceSet.cs @@ -39,18 +39,6 @@ public static partial ValueTask> CreateIsolate Func>> getReferencesAsync, CancellationToken cancellationToken); - private static ValueTask> DefaultCreateIsolatedAnalyzerReferencesAsync( - ImmutableArray references) - { - return ValueTaskFactory.FromResult(references); - } - - private static async ValueTask> DefaultCreateIsolatedAnalyzerReferencesAsync( - Func>> getReferencesAsync) - { - return await getReferencesAsync().ConfigureAwait(false); - } - public static Guid TryGetFileReferenceMvid(string filePath) { try