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

Remove A/B option for enabling features in SG docs. #73968

Merged
merged 3 commits into from
Jun 12, 2024
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 @@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

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

why was ValidateCompilationTrackerStates: true added?

Copy link
Member Author

Choose a reason for hiding this comment

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

it should have been there from teh beginning. it's helpful for tracking down bugs that jason cares about.

options?.OptionUpdater?.Invoke(workspace.GetService<IGlobalOptionService>());

workspace.GetService<LspWorkspaceRegistrationService>().Register(workspace);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<StorageDatabase> Database = new(
Expand All @@ -27,16 +23,6 @@ public static WorkspaceConfigurationOptions GetWorkspaceConfigurationOptions(thi
public static readonly Option2<bool> ValidateCompilationTrackerStates = new(
"dotnet_validate_compilation_tracker_states", WorkspaceConfigurationOptions.Default.ValidateCompilationTrackerStates);

/// <summary>
/// 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.
/// </summary>
public static readonly Option2<bool?> EnableOpeningSourceGeneratedFilesInWorkspace = new(
"dotnet_enable_opening_source_generated_files_in_workspace", defaultValue: null);

public static readonly Option2<bool> EnableOpeningSourceGeneratedFilesInWorkspaceFeatureFlag = new(
"dotnet_enable_opening_source_generated_files_in_workspace_feature_flag", WorkspaceConfigurationOptions.Default.EnableOpeningSourceGeneratedFiles);

public static readonly Option2<SourceGeneratorExecutionPreference?> SourceGeneratorExecution = new(
"dotnet_source_generator_execution",
defaultValue: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@

<CheckBox x:Name="Analyze_source_generated_files"
Content="{x:Static local:AdvancedOptionPageStrings.Option_analyze_source_generated_files}" />

<CheckBox x:Name="Enable_all_features_in_opened_files_from_source_generators"
Content="{x:Static local:AdvancedOptionPageStrings.Enable_all_features_in_opened_files_from_source_generators_experimental}" />

</StackPanel>
</GroupBox>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")},
Expand Down
3 changes: 0 additions & 3 deletions src/VisualStudio/Core/Def/ServicesVSResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1489,9 +1489,6 @@ Additional information: {1}</value>
<data name="Reference" xml:space="preserve">
<value>Reference</value>
</data>
<data name="Enable_all_features_in_opened_files_from_source_generators_experimental" xml:space="preserve">
<value>Enable all features in opened files from source generators (experimental)</value>
</data>
<data name="Remove_Unused_References" xml:space="preserve">
<value>Remove Unused References</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
5 changes: 0 additions & 5 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/VisualStudio/Core/Def/xlf/ServicesVSResources.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ public static void Main()
var configurationService = (WorkspaceConfigurationService)workspace.Services.GetRequiredService<IWorkspaceConfigurationService>();
configurationService.Clear();

var globalOptions = await TestServices.Shell.GetComponentModelServiceAsync<IGlobalOptionService>(HangMitigatingCancellationToken);
globalOptions.SetGlobalOption(WorkspaceConfigurationOptionsStorage.EnableOpeningSourceGeneratedFilesInWorkspace, true);

await TestServices.Editor.GoToDefinitionAsync(HangMitigatingCancellationToken);
Assert.Equal($"{HelloWorldGenerator.GeneratedEnglishClassName}.cs {ServicesVSResources.generated_suffix}", await TestServices.Shell.GetActiveWindowCaptionAsync(HangMitigatingCancellationToken));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@

<CheckBox x:Name="Analyze_source_generated_files"
Content="{x:Static local:AdvancedOptionPageStrings.Option_analyze_source_generated_files}" />

<CheckBox x:Name="Enable_all_features_in_opened_files_from_source_generators"
Content="{x:Static local:AdvancedOptionPageStrings.Enable_all_features_in_opened_files_from_source_generators_experimental}" />

</StackPanel>
</GroupBox>

Expand Down
Loading
Loading