-
Notifications
You must be signed in to change notification settings - Fork 4k
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
OptionKey clean-up and integration tests #66016
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmat
force-pushed
the
OptionKey
branch
6 times, most recently
from
December 18, 2022 20:27
df43ca5
to
34c41a3
Compare
dibarbet
reviewed
Dec 20, 2022
...orFeatures/CSharpTest/Completion/CompletionProviders/LoadDirectiveCompletionProviderTests.cs
Show resolved
Hide resolved
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Options/OptionKey2.cs
Show resolved
Hide resolved
src/Workspaces/Core/Portable/Options/LegacyWorkspaceOptionService.cs
Outdated
Show resolved
Hide resolved
dibarbet
approved these changes
Dec 20, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine, especially with the test. Note that I think Jon wanted to take a look as well
src/Workspaces/Core/Portable/Options/LegacyWorkspaceOptionService.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio/Core/Def/Options/VisualStudioSettingsOptionPersister.cs
Outdated
Show resolved
Hide resolved
jmarolf
reviewed
Dec 20, 2022
.../Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs
Outdated
Show resolved
Hide resolved
jmarolf
approved these changes
Dec 20, 2022
…obalOptions and clarifies the difference. Next, we replace OptionKey with OptionKey2 in all Roslyn code that does not deal with OptionSet or other public APIs that expose options. Eventually we'll be able to ban OptionKey internally. We also push all translations between internal and public code style option values into SolutionOptionSet and remove them from GlobalOptionService. The former exposes the values through public API while the latter does not. After this change global options only operate with internal representations. A lot of mechanical changes are needed for this change - the most interesting files to review are: OptionSet.cs, SolutionOptionSet.cs, GlobalOptionService.cs, OptionsHelpers.cs, OptionKeyTest.cs and GlobalOptionServiceTests.cs. Adds a new integration test that enumerates all global option definitions in Roslyn assemblies and validates that each of these options can be updated in VS. This addresses test hole where we did not validate reading options from VS settings/registry. Moves code that updates options of the current workspace solution to LegacyWorkspaceOptionService as it only implements legacy behavior and only affects code reading from Solution.Options, which shouldn't be done in Roslyn. There is a slight semantic change: the GlobalOptionsService.OptionChanged event is now triggered before the workspaces registered to LegacyWorkspaceOptionService get their current solutions updated. This is ok since the event is an internal event, not observable by public consumers of Workspace APIs and Roslyn code does not read global options from Solution.Options anymore. Removes UnitTestingOptionChangedEventArgsWrapper - not used by Unit Testing anymore.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The first commit simplifies implementation of GlobalOptionService.SetOptions and SetGlobalOptions and clarifies the difference.
Next, we replace OptionKey with OptionKey2 in all Roslyn code that does not deal with OptionSet or other public APIs that expose options. Eventually we'll be able to ban OptionKey internally. We also push all translations between internal and public code style option values into SolutionOptionSet and remove them from GlobalOptionService. The former exposes the values through public API while the latter does not. After this change global options only operate with internal representations. A lot of mechanical changes are needed for this change - the most interesting files to review are: OptionSet.cs, SolutionOptionSet.cs, GlobalOptionService.cs, OptionsHelpers.cs, OptionKeyTest.cs and GlobalOptionServiceTests.cs.
Adds a new integration test that enumerates all global option definitions in Roslyn assemblies and validates that each of these options can be updated in VS. This addresses test hole where we did not validate reading options from VS settings/registry.
Moves code that updates options of the current workspace solution to
LegacyWorkspaceOptionService
as it only implements legacy behavior and only affects code reading fromSolution.Options
, which shouldn't be done in Roslyn. There is a slight semantic change: the GlobalOptionsService.OptionChanged event is now triggered before the workspaces registered toLegacyWorkspaceOptionService
get their current solutions updated. This is ok since the event is an internal event, not observable by public consumers of Workspace APIs and Roslyn code does not read global options fromSolution.Options
anymore.Removes
UnitTestingOptionChangedEventArgsWrapper
- not used by Unit Testing anymore.Implements #65394