Add api to allow customizing options per DiagnosticAnalyzer#80200
Add api to allow customizing options per DiagnosticAnalyzer#80200CyrusNajmabadi merged 90 commits intodotnet:mainfrom
Conversation
| @@ -31,9 +31,9 @@ internal partial class AnalyzerExecutor | |||
| internal const string AnalyzerExceptionDiagnosticId = "AD0001"; | |||
There was a problem hiding this comment.
The meat of hte change is in this file.
src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerExecutor.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerExecutor.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerExecutor.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerExecutor.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerExecutor.cs
Outdated
Show resolved
Hide resolved
| // can use the same instance across all actions. | ||
| var context = new SemanticModelAnalysisContext( | ||
| semanticModel, AnalyzerOptions, diagReporter.AddDiagnosticAction, | ||
| semanticModel, options, diagReporter.AddDiagnosticAction, |
There was a problem hiding this comment.
| semanticModel, options, diagReporter.AddDiagnosticAction, | |
| semanticModel, analyzerOptions, diagReporter.AddDiagnosticAction, |
|
Ok. Performance seems unchanged: |
|
@dotnet/roslyn-compiler for eyes. Tnx :) |
|
@dotnet/roslyn-compiler for reviews :) |
src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerOptions.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerDriver.cs
Outdated
Show resolved
Hide resolved
|
|
||
| // Deduping map for the distinct AnalyzerConfigOptionsProvider we get back from getAnalyzerConfigOptionsProvider. | ||
| // The common case in VS host is that there is generally only 1-2 of these providers. For example, a provider | ||
| // that looks in editorconfig+vsoptions, and a provider that only looks in editorconfig. We only want to make |
There was a problem hiding this comment.
Unrelated to this PR: I'm planning to enable analyzer redirecting in dev18 which would redirect built-in SDK analyzers to ones inserted in VS (to avoid compiler version mismatch). I'm not sure if that is going to break the logic of analyzer option loading.
There was a problem hiding this comment.
Pinging you offline :)
There was a problem hiding this comment.
Talked offline. We're good. The redirection tthat is done doesn't affect the status of these references as 'project references'. It just impacts the location they are loaded from. So we will still see these as project-level references, and will appropriately hookup the right non-fallback options.
Co-authored-by: Jan Jones <jan.jones.cz@gmail.com>
|
@dotnet/roslyn-compiler for final set of eyes. |
API approved in #80143