-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEuntriagedIssues and PRs which have not yet been triaged by a leadIssues and PRs which have not yet been triaged by a lead
Description
Version Used: 4.3.0-2.final and newer
Steps to Reproduce:
- Create an analyzer project
- Attempt to test the analyzer with custom values of FormattingOptions.IndentationSize in the workspace
Expected Behavior:
The indentation is accounted for in the code fix behavior.
Actual Behavior:
There is no implementation of ILegacyGlobalOptionsWorkspaceService provided, so the code fix ends up using CodeActionOptions.DefaultProvider instead of the options defined by the user.
roslyn/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs
Lines 335 to 337 in 05243d8
| // TODO: avoid ILegacyGlobalOptionsWorkspaceService https://github.com/dotnet/roslyn/issues/60777 | |
| var globalOptions = document.Project.Solution.Services.GetService<ILegacyGlobalOptionsWorkspaceService>(); | |
| var fallbackOptions = globalOptions?.CleanCodeGenerationOptionsProvider ?? CodeActionOptions.DefaultProvider; |
Additional Context:
This is blocking the move of StyleCop Analyzers to testing against Roslyn 4.4.0 / C# 11 in DotNetAnalyzers/StyleCopAnalyzers#3580.
Metadata
Metadata
Assignees
Labels
Area-IDEuntriagedIssues and PRs which have not yet been triaged by a leadIssues and PRs which have not yet been triaged by a lead