Skip to content

Commit

Permalink
VisualStudioNavigationOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Cosifne committed Feb 22, 2023
1 parent 488b976 commit 1f04902
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.VisualStudio.LanguageServices.Implementation
{
internal sealed class VisualStudioNavigationOptions
internal sealed class VisualStudioNavigationOptionsStorage
{
public static readonly PerLanguageOption2<bool> NavigateToObjectBrowser = new("dotnet_navigation_options_navigate_to_object_browser", defaultValue: false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public VisualStudioSymbolNavigationService(
}

// Should we prefer navigating to the Object Browser over metadata-as-source?
if (_globalOptions.GetOption(VisualStudioNavigationOptions.NavigateToObjectBrowser, project.Language))
if (_globalOptions.GetOption(VisualStudioNavigationOptionsStorage.NavigateToObjectBrowser, project.Language))
{
var libraryService = project.Services.GetService<ILibraryService>();
if (libraryService == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public async Task ResetGlobalOptionsAsync(CancellationToken cancellationToken)
ResetOption(globalOptions, MetadataAsSourceOptionsStorage.NavigateToDecompiledSources);
ResetOption(globalOptions, WorkspaceConfigurationOptionsStorage.EnableOpeningSourceGeneratedFilesInWorkspace);
ResetPerLanguageOption(globalOptions, NavigationBarViewOptionsStorage.ShowNavigationBar);
ResetPerLanguageOption(globalOptions, VisualStudioNavigationOptions.NavigateToObjectBrowser);
ResetPerLanguageOption(globalOptions, VisualStudioNavigationOptionsStorage.NavigateToObjectBrowser);
ResetPerLanguageOption(globalOptions, FeatureOnOffOptions.AddImportsOnPaste);
ResetPerLanguageOption(globalOptions, FeatureOnOffOptions.PrettyListing);
ResetPerLanguageOption(globalOptions, CompletionViewOptionsStorage.EnableArgumentCompletionSnippets);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ await SetUpEditorAsync(
@"Class C
Dim i As Integer$$
End Class", HangMitigatingCancellationToken);
globalOptions.SetGlobalOption(VisualStudioNavigationOptions.NavigateToObjectBrowser, LanguageNames.VisualBasic, true);
globalOptions.SetGlobalOption(VisualStudioNavigationOptionsStorage.NavigateToObjectBrowser, LanguageNames.VisualBasic, true);

await TestServices.Editor.GoToDefinitionAsync(HangMitigatingCancellationToken);
Assert.Equal("Object Browser", await TestServices.Shell.GetActiveWindowCaptionAsync(HangMitigatingCancellationToken));

globalOptions.SetGlobalOption(VisualStudioNavigationOptions.NavigateToObjectBrowser, LanguageNames.VisualBasic, false);
globalOptions.SetGlobalOption(VisualStudioNavigationOptionsStorage.NavigateToObjectBrowser, LanguageNames.VisualBasic, false);
globalOptions.SetGlobalOption(MetadataAsSourceOptionsStorage.NavigateToDecompiledSources, false);

await TestServices.SolutionExplorer.OpenFileAsync(ProjectName, "Class1.vb", HangMitigatingCancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.VisualBasic.Options
BindToOption(Underline_reassigned_variables, ClassificationOptionsStorage.ClassifyReassignedVariables, LanguageNames.VisualBasic)

' Go To Definition
BindToOption(NavigateToObjectBrowser, VisualStudioNavigationOptions.NavigateToObjectBrowser, LanguageNames.VisualBasic)
BindToOption(NavigateToObjectBrowser, VisualStudioNavigationOptionsStorage.NavigateToObjectBrowser, LanguageNames.VisualBasic)
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.
Expand Down

0 comments on commit 1f04902

Please sign in to comment.