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

Implement legacy options provider for code actions in workspace layer #66798

Merged
merged 1 commit into from
Mar 1, 2023

Conversation

tmat
Copy link
Member

@tmat tmat commented Feb 10, 2023

Adds a new service interface ILegacyGlobalCleanCodeGenerationOptionsWorkspaceService that is used in a few places in workspace layer where a provider for CleanCodeGenerationOptions is needed for fallback options, but the fallback options can't currently be passed to that code from a higher layer.

Previously the provider was retrieved from ILegacyGlobalOptionsWorkspaceService, but the implementation of that service can't be moved to Workspace layer due to additional dependencies.

Uses the recently introduced IOptionsReader to eliminate duplicate option reading code.

Fixes #66779

@tmat tmat requested a review from a team as a code owner February 10, 2023 02:39
@@ -20,7 +18,6 @@ namespace Microsoft.CodeAnalysis.Options
internal sealed class LegacyGlobalOptionsWorkspaceService : ILegacyGlobalOptionsWorkspaceService
Copy link
Member

Choose a reason for hiding this comment

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

📝 This needs to be updated to use ServiceLayer.Editor

Copy link
Member Author

Choose a reason for hiding this comment

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

Does it? This implements a different service interface than what I added to workspace

Copy link
Member

Choose a reason for hiding this comment

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

I missed that it was a different interface, but yes since this is the editor layer. It would be reasonable to add a default implementation in the workspaces layer (even if it just takes no action) and we wouldn't want it to conflict in that case.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can follow up on that when I get back.

@tmat tmat enabled auto-merge (squash) February 11, 2023 18:37
@tmat tmat merged commit 683a5cb into dotnet:main Mar 1, 2023
@ghost ghost added this to the Next milestone Mar 1, 2023
@tmat tmat deleted the LegacyCodeActionOptions branch March 1, 2023 20:47
@RikkiGibson RikkiGibson modified the milestones: Next, 17.6 P2 Mar 2, 2023
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.

ILegacyGlobalOptionsWorkspaceService does not provide an implementation in the workspaces layer
3 participants