From eb4d01e3bcf25f9e928b6742ea25a4b51dfb92f2 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Wed, 12 Jun 2024 09:47:19 -0700 Subject: [PATCH 1/2] Remove feature flags for enabling features in SG docs. --- .../AbstractLanguageServerProtocolTests.cs | 2 +- .../WorkspaceConfigurationOptionsStorage.cs | 14 -------------- .../Options/AdvancedOptionPageControl.xaml | 4 ---- .../Options/AdvancedOptionPageControl.xaml.cs | 6 ------ .../Impl/Options/AdvancedOptionPageStrings.cs | 3 --- .../Def/Options/VisualStudioOptionStorage.cs | 2 -- .../Core/Def/ServicesVSResources.resx | 3 --- .../Workspace/SourceGeneratedFileManager.cs | 6 +----- .../Core/Def/xlf/ServicesVSResources.cs.xlf | 5 ----- .../Core/Def/xlf/ServicesVSResources.de.xlf | 5 ----- .../Core/Def/xlf/ServicesVSResources.es.xlf | 5 ----- .../Core/Def/xlf/ServicesVSResources.fr.xlf | 5 ----- .../Core/Def/xlf/ServicesVSResources.it.xlf | 5 ----- .../Core/Def/xlf/ServicesVSResources.ja.xlf | 5 ----- .../Core/Def/xlf/ServicesVSResources.ko.xlf | 5 ----- .../Core/Def/xlf/ServicesVSResources.pl.xlf | 5 ----- .../Core/Def/xlf/ServicesVSResources.pt-BR.xlf | 5 ----- .../Core/Def/xlf/ServicesVSResources.ru.xlf | 5 ----- .../Core/Def/xlf/ServicesVSResources.tr.xlf | 5 ----- .../Def/xlf/ServicesVSResources.zh-Hans.xlf | 5 ----- .../Def/xlf/ServicesVSResources.zh-Hant.xlf | 5 ----- .../Options/AdvancedOptionPageControl.xaml | 4 ---- .../Options/AdvancedOptionPageControl.xaml.vb | 5 ----- .../Impl/Options/AdvancedOptionPageStrings.vb | 3 --- .../IWorkspaceConfigurationService.cs | 18 ++++++++---------- .../CoreTest/Options/OptionSerializerTests.cs | 1 - 26 files changed, 10 insertions(+), 126 deletions(-) diff --git a/src/EditorFeatures/TestUtilities/LanguageServer/AbstractLanguageServerProtocolTests.cs b/src/EditorFeatures/TestUtilities/LanguageServer/AbstractLanguageServerProtocolTests.cs index 74751f7ee2134..e21ce155e6632 100644 --- a/src/EditorFeatures/TestUtilities/LanguageServer/AbstractLanguageServerProtocolTests.cs +++ b/src/EditorFeatures/TestUtilities/LanguageServer/AbstractLanguageServerProtocolTests.cs @@ -384,7 +384,7 @@ internal EditorTestWorkspace CreateWorkspace( InitializationOptions? options, string? workspaceKind, bool mutatingLspWorkspace, TestComposition? composition = null) { var workspace = new EditorTestWorkspace( - composition ?? Composition, workspaceKind, configurationOptions: new WorkspaceConfigurationOptions(EnableOpeningSourceGeneratedFiles: true), supportsLspMutation: mutatingLspWorkspace); + composition ?? Composition, workspaceKind, configurationOptions: new WorkspaceConfigurationOptions(ValidateCompilationTrackerStates: true), supportsLspMutation: mutatingLspWorkspace); options?.OptionUpdater?.Invoke(workspace.GetService()); workspace.GetService().Register(workspace); diff --git a/src/LanguageServer/Protocol/Features/Options/WorkspaceConfigurationOptionsStorage.cs b/src/LanguageServer/Protocol/Features/Options/WorkspaceConfigurationOptionsStorage.cs index 8fab97e720a1e..9407236192274 100644 --- a/src/LanguageServer/Protocol/Features/Options/WorkspaceConfigurationOptionsStorage.cs +++ b/src/LanguageServer/Protocol/Features/Options/WorkspaceConfigurationOptionsStorage.cs @@ -12,13 +12,9 @@ internal static class WorkspaceConfigurationOptionsStorage public static WorkspaceConfigurationOptions GetWorkspaceConfigurationOptions(this IGlobalOptionService globalOptions) => new( CacheStorage: globalOptions.GetOption(Database), - EnableOpeningSourceGeneratedFiles: - globalOptions.GetOption(EnableOpeningSourceGeneratedFilesInWorkspace) ?? - globalOptions.GetOption(EnableOpeningSourceGeneratedFilesInWorkspaceFeatureFlag), SourceGeneratorExecution: globalOptions.GetOption(SourceGeneratorExecution) ?? (globalOptions.GetOption(SourceGeneratorExecutionBalancedFeatureFlag) ? SourceGeneratorExecutionPreference.Balanced : SourceGeneratorExecutionPreference.Automatic), - ValidateCompilationTrackerStates: globalOptions.GetOption(ValidateCompilationTrackerStates)); public static readonly Option2 Database = new( @@ -27,16 +23,6 @@ public static WorkspaceConfigurationOptions GetWorkspaceConfigurationOptions(thi public static readonly Option2 ValidateCompilationTrackerStates = new( "dotnet_validate_compilation_tracker_states", WorkspaceConfigurationOptions.Default.ValidateCompilationTrackerStates); - /// - /// This option allows the user to enable this. We are putting this behind a feature flag for now since we could have extensions - /// surprised by this and we want some time to work through those issues. - /// - public static readonly Option2 EnableOpeningSourceGeneratedFilesInWorkspace = new( - "dotnet_enable_opening_source_generated_files_in_workspace", defaultValue: null); - - public static readonly Option2 EnableOpeningSourceGeneratedFilesInWorkspaceFeatureFlag = new( - "dotnet_enable_opening_source_generated_files_in_workspace_feature_flag", WorkspaceConfigurationOptions.Default.EnableOpeningSourceGeneratedFiles); - public static readonly Option2 SourceGeneratorExecution = new( "dotnet_source_generator_execution", defaultValue: null, diff --git a/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml b/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml index 5ce325804d331..2c36e6160d267 100644 --- a/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml +++ b/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml @@ -86,10 +86,6 @@ - - - diff --git a/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs b/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs index 7cdd7d89ef7b0..97420ed39698e 100644 --- a/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs +++ b/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageControl.xaml.cs @@ -95,12 +95,6 @@ public AdvancedOptionPageControl(OptionStore optionStore, IComponentModel compon // If the option has not been set by the user, check if the option is enabled from experimentation. If so, default to that. return optionStore.GetOption(SolutionCrawlerOptionsStorage.EnableDiagnosticsInSourceGeneratedFilesFeatureFlag); }); - BindToOption(Enable_all_features_in_opened_files_from_source_generators, WorkspaceConfigurationOptionsStorage.EnableOpeningSourceGeneratedFilesInWorkspace, () => - { - // If the option has not been set by the user, check if the option is enabled from experimentation. - // If so, default to that. - return optionStore.GetOption(WorkspaceConfigurationOptionsStorage.EnableOpeningSourceGeneratedFilesInWorkspaceFeatureFlag); - }); // Go To Definition BindToOption(Enable_navigation_to_sourcelink_and_embedded_sources, MetadataAsSourceOptionsStorage.NavigateToSourceLinkAndEmbeddedSources); diff --git a/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs b/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs index 329ae543c94ac..5c55c8b3cceea 100644 --- a/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs +++ b/src/VisualStudio/CSharp/Impl/Options/AdvancedOptionPageStrings.cs @@ -339,9 +339,6 @@ public static ColorSchemeName Color_Scheme_VisualStudio2017_Tag public static string Option_Show_Remove_Unused_References_command_in_Solution_Explorer_experimental => ServicesVSResources.Show_Remove_Unused_References_command_in_Solution_Explorer_experimental; - public static string Enable_all_features_in_opened_files_from_source_generators_experimental - => ServicesVSResources.Enable_all_features_in_opened_files_from_source_generators_experimental; - public static string Option_Enable_file_logging_for_diagnostics => ServicesVSResources.Enable_file_logging_for_diagnostics; diff --git a/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs b/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs index a266a724e10d9..03065fce406a1 100644 --- a/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs +++ b/src/VisualStudio/Core/Def/Options/VisualStudioOptionStorage.cs @@ -424,8 +424,6 @@ public bool TryFetch(LocalUserRegistryOptionPersister persister, OptionKey2 opti {"dotnet_validate_compilation_tracker_states", new FeatureFlagStorage(@"Roslyn.ValidateCompilationTrackerStates")}, {"dotnet_enable_diagnostics_in_source_generated_files", new RoamingProfileStorage("TextEditor.Roslyn.Specific.EnableDiagnosticsInSourceGeneratedFilesExperiment")}, {"dotnet_enable_diagnostics_in_source_generated_files_feature_flag", new FeatureFlagStorage(@"Roslyn.EnableDiagnosticsInSourceGeneratedFiles")}, - {"dotnet_enable_opening_source_generated_files_in_workspace", new RoamingProfileStorage("TextEditor.Roslyn.Specific.EnableOpeningSourceGeneratedFilesInWorkspaceExperiment")}, - {"dotnet_enable_opening_source_generated_files_in_workspace_feature_flag", new FeatureFlagStorage(@"Roslyn.SourceGeneratorsEnableOpeningInWorkspace")}, {"dotnet_source_generator_execution", new RoamingProfileStorage("TextEditor.Roslyn.Specific.SourceGeneratorExecution")}, {"dotnet_source_generator_execution_balanced_feature_flag", new FeatureFlagStorage(@"Roslyn.SourceGeneratorExecutionBalanced")}, {"xaml_enable_lsp_intellisense", new FeatureFlagStorage(@"Xaml.EnableLspIntelliSense")}, diff --git a/src/VisualStudio/Core/Def/ServicesVSResources.resx b/src/VisualStudio/Core/Def/ServicesVSResources.resx index 374efed02fbb5..98b39446ba210 100644 --- a/src/VisualStudio/Core/Def/ServicesVSResources.resx +++ b/src/VisualStudio/Core/Def/ServicesVSResources.resx @@ -1489,9 +1489,6 @@ Additional information: {1} Reference - - Enable all features in opened files from source generators (experimental) - Remove Unused References diff --git a/src/VisualStudio/Core/Def/Workspace/SourceGeneratedFileManager.cs b/src/VisualStudio/Core/Def/Workspace/SourceGeneratedFileManager.cs index 1bb5c963478d4..d31b443350ebd 100644 --- a/src/VisualStudio/Core/Def/Workspace/SourceGeneratedFileManager.cs +++ b/src/VisualStudio/Core/Def/Workspace/SourceGeneratedFileManager.cs @@ -405,12 +405,8 @@ public async ValueTask RefreshFileAsync(CancellationToken cancellationToken) // If the file isn't already open, open it now. We may transition between opening and closing // if the file is repeatedly appearing and disappearing. - var connectToWorkspace = _workspaceConfigurationService?.Options.EnableOpeningSourceGeneratedFiles != false; - - if (connectToWorkspace && !this.Workspace.IsDocumentOpen(_documentIdentity.DocumentId)) - { + if (!this.Workspace.IsDocumentOpen(_documentIdentity.DocumentId)) this.Workspace.OnSourceGeneratedDocumentOpened(_textBuffer.AsTextContainer(), generatedDocument); - } } finally { diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf index 870eb7f11ed19..8c868bf5d3962 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf @@ -397,11 +397,6 @@ Element není platný. - - Enable all features in opened files from source generators (experimental) - Povolit všechny funkce v otevřených souborech ze zdrojových generátorů (experimentální) - - Enable document outline (experimental, requires restart) Povolit osnovu dokumentu (experimentální, vyžaduje restartování) diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf index 4ef28e38ac3f9..9d52afe126846 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf @@ -397,11 +397,6 @@ Das Element ist ungültig. - - Enable all features in opened files from source generators (experimental) - Aktivieren aller Funktionen in geöffneten Dateien von Quellgeneratoren (experimentell) - - Enable document outline (experimental, requires restart) Dokumentgliederung aktivieren (experimentell, Neustart erforderlich) diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf index 01c6dad649d78..79782eed35c1e 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf @@ -397,11 +397,6 @@ El elemento no es válido. - - Enable all features in opened files from source generators (experimental) - Habilitar todas las características de los archivos abiertos de los generadores de origen (experimental) - - Enable document outline (experimental, requires restart) Habilitar esquema de documento (experimental, requiere reinicio) diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf index 6ccd478502a98..dc18a73e70632 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf @@ -397,11 +397,6 @@ L'élément n'est pas valide. - - Enable all features in opened files from source generators (experimental) - Activer toutes les fonctionnalités dans les fichiers ouverts à partir des générateurs de code source (expérimental) - - Enable document outline (experimental, requires restart) Activer le plan du document (expérimental, nécessite un redémarrage) diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf index e20fa8c9d0a67..077d209781b7d 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf @@ -397,11 +397,6 @@ L'elemento non è valido. - - Enable all features in opened files from source generators (experimental) - Abilita tutte le funzionalità nei file aperti dai generatori di origine (sperimentale) - - Enable document outline (experimental, requires restart) Abilita struttura documento (sperimentale, richiede il riavvio) diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf index a2906f99ae57e..29512ddd33bc4 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf @@ -397,11 +397,6 @@ 要素が有効ではありません。 - - Enable all features in opened files from source generators (experimental) - ソース ジェネレーターから開いたファイル内のすべての機能を有効にする (試験段階) - - Enable document outline (experimental, requires restart) ドキュメント アウトラインを有効にする (試験段階、再起動が必要) diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf index 98c46661fa844..178b6df549c1d 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf @@ -397,11 +397,6 @@ 요소가 잘못되었습니다. - - Enable all features in opened files from source generators (experimental) - 소스 생성기에서 열린 파일의 모든 기능 사용 (실험적) - - Enable document outline (experimental, requires restart) 문서 개요 사용(실험적, 다시 시작해야 함) diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf index eff47657ecf77..be395078288e4 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf @@ -397,11 +397,6 @@ Element jest nieprawidłowy. - - Enable all features in opened files from source generators (experimental) - Włącz wszystkie funkcje w otwartych plikach z generatorów źródeł (eksperymentalne) - - Enable document outline (experimental, requires restart) Włącz konspekt dokumentu (eksperymentalne, wymaga ponownego uruchomienia) diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf index dfa6a6fd905c5..25d424549122b 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf @@ -397,11 +397,6 @@ O elemento é inválido. - - Enable all features in opened files from source generators (experimental) - Habilitar todos os recursos nos arquivos abertos dos geradores de origem (experimental) - - Enable document outline (experimental, requires restart) Habilitar resumo do documento (experimental, requer reinicialização) diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf index cd9eb81db03a2..2d0406b10f9ba 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf @@ -397,11 +397,6 @@ Элемент недопустим. - - Enable all features in opened files from source generators (experimental) - Включить все функции в открытых файлах из генераторов источника (экспериментальная версия) - - Enable document outline (experimental, requires restart) Включить структуру документа (экспериментальная функция, требуется перезапуск) diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf index e56267e6af81e..35417d153dc19 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf @@ -397,11 +397,6 @@ Öğe geçerli değil. - - Enable all features in opened files from source generators (experimental) - Kaynak oluşturuculardan alınan açık sayfalarda tüm özellikleri etkinleştir (deneysel) - - Enable document outline (experimental, requires restart) Belge ana hattını etkinleştir (deneysel, yeniden başlatma gerektirir) diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf index 4125ad72481bd..56f9038fb5ad5 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hans.xlf @@ -397,11 +397,6 @@ 元素无效。 - - Enable all features in opened files from source generators (experimental) - 从源生成器在打开的文件中启用所有功能(实验性) - - Enable document outline (experimental, requires restart) 启用文档大纲(实验性,需要重启) diff --git a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf index 2abaa2a348650..d43c7673ab4c2 100644 --- a/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf +++ b/src/VisualStudio/Core/Def/xlf/ServicesVSResources.zh-Hant.xlf @@ -397,11 +397,6 @@ 元素無效。 - - Enable all features in opened files from source generators (experimental) - 從來源產生器中,啟用已開啟檔案中的所有功能 (實驗性) - - Enable document outline (experimental, requires restart) 啟用文件大綱 (實驗性,需要重新開機) diff --git a/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml b/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml index ceaccb9523848..4d71c1c21df4e 100644 --- a/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml +++ b/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml @@ -86,10 +86,6 @@ - - - diff --git a/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml.vb b/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml.vb index 4b231346694b5..7fe5f25c4cd7f 100644 --- a/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml.vb +++ b/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageControl.xaml.vb @@ -93,11 +93,6 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Options ' If the option has not been set by the user, check if the option is enabled from experimentation. Return optionStore.GetOption(SolutionCrawlerOptionsStorage.EnableDiagnosticsInSourceGeneratedFilesFeatureFlag) End Function) - BindToOption(Enable_all_features_in_opened_files_from_source_generators, WorkspaceConfigurationOptionsStorage.EnableOpeningSourceGeneratedFilesInWorkspace, - Function() - ' If the option has Not been set by the user, check if the option is enabled from experimentation. - Return optionStore.GetOption(WorkspaceConfigurationOptionsStorage.EnableOpeningSourceGeneratedFilesInWorkspaceFeatureFlag) - End Function) ' Rename BindToOption(Rename_asynchronously_exerimental, InlineRenameSessionOptionsStorage.RenameAsynchronously) diff --git a/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageStrings.vb b/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageStrings.vb index aae560e647242..b6ac29d64e43f 100644 --- a/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageStrings.vb +++ b/src/VisualStudio/VisualBasic/Impl/Options/AdvancedOptionPageStrings.vb @@ -342,9 +342,6 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Options Public ReadOnly Property Option_Show_Remove_Unused_References_command_in_Solution_Explorer_experimental As String = ServicesVSResources.Show_Remove_Unused_References_command_in_Solution_Explorer_experimental - Public ReadOnly Property Enable_all_features_in_opened_files_from_source_generators_experimental As String = - ServicesVSResources.Enable_all_features_in_opened_files_from_source_generators_experimental - Public ReadOnly Property Option_Enable_file_logging_for_diagnostics As String = ServicesVSResources.Enable_file_logging_for_diagnostics diff --git a/src/Workspaces/Core/Portable/Workspace/IWorkspaceConfigurationService.cs b/src/Workspaces/Core/Portable/Workspace/IWorkspaceConfigurationService.cs index 86d5673603214..7001dd71f4377 100644 --- a/src/Workspaces/Core/Portable/Workspace/IWorkspaceConfigurationService.cs +++ b/src/Workspaces/Core/Portable/Workspace/IWorkspaceConfigurationService.cs @@ -26,18 +26,17 @@ internal sealed class DefaultWorkspaceConfigurationService() : IWorkspaceConfigu /// /// Options that affect behavior of workspace core APIs (, , , , etc.) to which it would be impractical to flow these options -/// explicitly. The options are instead provided by . The remote -/// instance of this service is initialized based on the in-proc values (which themselves are loaded from global -/// options) when we establish connection from devenv to ServiceHub process. If another process connects to our -/// ServiceHub process before that the remote instance provides a predefined set of options that can later be updated when devenv connects to the ServiceHub process. +/// explicitly. The options are instead provided by . The remote instance of +/// this service is initialized based on the in-proc values (which themselves are loaded from global options) when we +/// establish connection from devenv to ServiceHub process. If another process connects to our ServiceHub process before +/// that the remote instance provides a predefined set of options that can later be updated +/// when devenv connects to the ServiceHub process. /// [DataContract] internal readonly record struct WorkspaceConfigurationOptions( [property: DataMember(Order = 0)] StorageDatabase CacheStorage = StorageDatabase.SQLite, - [property: DataMember(Order = 1)] bool EnableOpeningSourceGeneratedFiles = false, - [property: DataMember(Order = 2)] SourceGeneratorExecutionPreference SourceGeneratorExecution = SourceGeneratorExecutionPreference.Automatic, - [property: DataMember(Order = 3)] bool ValidateCompilationTrackerStates = + [property: DataMember(Order = 1)] SourceGeneratorExecutionPreference SourceGeneratorExecution = SourceGeneratorExecutionPreference.Automatic, + [property: DataMember(Order = 2)] bool ValidateCompilationTrackerStates = #if DEBUG // We will default this on in DEBUG builds true #else @@ -57,6 +56,5 @@ public WorkspaceConfigurationOptions() /// to non-defaults while the services have already been executing. /// public static readonly WorkspaceConfigurationOptions RemoteDefault = new( - CacheStorage: StorageDatabase.None, - EnableOpeningSourceGeneratedFiles: false); + CacheStorage: StorageDatabase.None); } diff --git a/src/Workspaces/CoreTest/Options/OptionSerializerTests.cs b/src/Workspaces/CoreTest/Options/OptionSerializerTests.cs index ed38573681234..62608e022fbe0 100644 --- a/src/Workspaces/CoreTest/Options/OptionSerializerTests.cs +++ b/src/Workspaces/CoreTest/Options/OptionSerializerTests.cs @@ -27,7 +27,6 @@ public void SerializationAndDeserializationForNullableBool([CombinatorialValues( CompletionViewOptionsStorage.EnableArgumentCompletionSnippets, FeatureOnOffOptions.OfferRemoveUnusedReferences, InheritanceMarginOptionsStorage.ShowInheritanceMargin, - WorkspaceConfigurationOptionsStorage.EnableOpeningSourceGeneratedFilesInWorkspace, SolutionCrawlerOptionsStorage.EnableDiagnosticsInSourceGeneratedFiles, CompletionOptionsStorage.ShowItemsFromUnimportedNamespaces, CompletionOptionsStorage.ShowNewSnippetExperienceUserOption, From e2b3fa1d39d7f48a1c968220fb2d6aa2262ec0bb Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Wed, 12 Jun 2024 09:53:04 -0700 Subject: [PATCH 2/2] Update tests --- .../New.IntegrationTests/CSharp/CSharpSourceGenerators.cs | 3 --- .../New.IntegrationTests/InProcess/StateResetInProcess.cs | 1 - 2 files changed, 4 deletions(-) diff --git a/src/VisualStudio/IntegrationTest/New.IntegrationTests/CSharp/CSharpSourceGenerators.cs b/src/VisualStudio/IntegrationTest/New.IntegrationTests/CSharp/CSharpSourceGenerators.cs index 11cbffacc5729..531912d893bc0 100644 --- a/src/VisualStudio/IntegrationTest/New.IntegrationTests/CSharp/CSharpSourceGenerators.cs +++ b/src/VisualStudio/IntegrationTest/New.IntegrationTests/CSharp/CSharpSourceGenerators.cs @@ -101,9 +101,6 @@ public static void Main() var configurationService = (WorkspaceConfigurationService)workspace.Services.GetRequiredService(); configurationService.Clear(); - var globalOptions = await TestServices.Shell.GetComponentModelServiceAsync(HangMitigatingCancellationToken); - globalOptions.SetGlobalOption(WorkspaceConfigurationOptionsStorage.EnableOpeningSourceGeneratedFilesInWorkspace, true); - await TestServices.Editor.GoToDefinitionAsync(HangMitigatingCancellationToken); Assert.Equal($"{HelloWorldGenerator.GeneratedEnglishClassName}.cs {ServicesVSResources.generated_suffix}", await TestServices.Shell.GetActiveWindowCaptionAsync(HangMitigatingCancellationToken)); } diff --git a/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/StateResetInProcess.cs b/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/StateResetInProcess.cs index b3382b67cf858..cce8b434279f0 100644 --- a/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/StateResetInProcess.cs +++ b/src/VisualStudio/IntegrationTest/New.IntegrationTests/InProcess/StateResetInProcess.cs @@ -61,7 +61,6 @@ public async Task ResetGlobalOptionsAsync(CancellationToken cancellationToken) ResetOption(globalOptions, InlineRenameSessionOptionsStorage.RenameOverloads); ResetOption(globalOptions, InlineRenameUIOptionsStorage.UseInlineAdornment); ResetOption(globalOptions, MetadataAsSourceOptionsStorage.NavigateToDecompiledSources); - ResetOption(globalOptions, WorkspaceConfigurationOptionsStorage.EnableOpeningSourceGeneratedFilesInWorkspace); ResetOption(globalOptions, WorkspaceConfigurationOptionsStorage.SourceGeneratorExecution); ResetOption(globalOptions, WorkspaceConfigurationOptionsStorage.SourceGeneratorExecutionBalancedFeatureFlag); ResetPerLanguageOption(globalOptions, BlockStructureOptionsStorage.CollapseSourceLinkEmbeddedDecompiledFilesWhenFirstOpened);