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

Make CompletionOptions global #59117

Merged
merged 9 commits into from
Feb 4, 2022
Merged

Conversation

tmat
Copy link
Member

@tmat tmat commented Jan 27, 2022

Removes CompletionOptions from Solution snapshot. The options are now only stored in global options.

Establishes a new pattern: Option definitions move from being nested as XyzOptions.Metadata to a separate type XyzOptionsStorage (CompilationOptionsStorage in this case) that also defines an extension method GetXyzOptions on IGlobalOptionService used to fetch them. This type is to be moved to client code (editor features).

This completes the separation of options from their metadata and storage.

While working on this refactoring I realized that certain scenarios were broken by previous completion options changes. When 3rd party code passes OptionSet containing their custom options into our public completion APIs these options got lost and were not available to their custom CompletionProvider. This PR fixes that by passing 3rd party options through.

@tmat tmat force-pushed the GlobalCompletionOptions branch 3 times, most recently from f1e9e26 to e2e335c Compare January 31, 2022 22:55
@tmat tmat marked this pull request as ready for review January 31, 2022 23:07
@tmat tmat requested review from a team as code owners January 31, 2022 23:07
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi left a comment

Choose a reason for hiding this comment

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

LGTM. have some questions i'd like some clarity on just to make sure my understanding is correct.

Comment on lines +14 to +15
/// TODO: Options are currently explicitly listed since <see cref="OptionKey"/> is not serializable.
/// https://github.com/dotnet/roslyn/issues/59267
Copy link
Member

Choose a reason for hiding this comment

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

💡 I recommend resolving this as won't fix. New integration tests already support OptionKey directly, and old integration tests are being actively ported to the new library.

@tmat tmat merged commit d8862d6 into dotnet:main Feb 4, 2022
@ghost ghost added this to the Next milestone Feb 4, 2022
@RikkiGibson RikkiGibson modified the milestones: Next, 17.2.P1 Feb 4, 2022
@tmat tmat deleted the GlobalCompletionOptions branch February 4, 2022 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants