-
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
Only provide fallback options for host analyzers #75317
Conversation
This PR modifies public API files. Please follow the instructions at https://github.com/dotnet/roslyn/blob/main/docs/contributing/API%20Review%20Process.md for ensuring all public APIs are reviewed before merging. |
...torFeatures/CSharpTest/Diagnostics/DiagnosticAnalyzerDriver/DiagnosticAnalyzerDriverTests.cs
Show resolved
Hide resolved
src/EditorFeatures/Core/EditorConfigSettings/DataProvider/SettingsProviderBase.cs
Show resolved
Hide resolved
...Portable/Workspace/Solution/SolutionCompilationState.RegularCompilationTracker_Generators.cs
Show resolved
Hide resolved
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/DocumentExtensions.cs
Show resolved
Hide resolved
foreach (var reference in _project.Solution.AnalyzerReferences.Concat(_project.AnalyzerReferences)) | ||
using var _1 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var projectAnalyzerBuilder); | ||
using var _2 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var hostAnalyzerBuilder); | ||
foreach (var reference in _project.Solution.AnalyzerReferences) | ||
{ |
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.
Perhaps the loop can be factored to a local function and AppendAnalyzerMap can be inlined.
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.
➡️ This is small enough that I'll leave it for now.
src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/DocumentExtensions.cs
Show resolved
Hide resolved
What do we need before this can be published? |
@@ -333,14 +360,84 @@ public AnalyzerConfigData GetAnalyzerOptionsForPath(string path, CancellationTok | |||
} | |||
|
|||
internal sealed class ProjectAnalyzerConfigOptionsProvider(ProjectState projectState) : AnalyzerConfigOptionsProvider | |||
{ | |||
private AnalyzerConfigOptionsCache.Value GetCache() |
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.
Deduplicate code in a follow up. E.g. use a common base class
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.
Approved assuming a clean-up will be done in a follow up PR.
Items not covered by this pull request
Known issues introduced by this change
CompilationWithAnalyzers
instances, but for the host instance, only the diagnostic suppressors should run. NuGet-installed diagnostic suppressors should be able to suppress VSIX-installed analyzer diagnostics #75399