Diagnostic suppressions from editorconfig are ignored in source-generated syntax trees #52014
Labels
Area-Compilers
New Feature - Source Generators
Source Generators
Resolution-By Design
The behavior reported in the issue matches the current design
Repro:
syntax.xml
to add some new public APIseng\generate-compiler-code.cmd
followed bybuild.cmd -runAnalyzers
: notice RS0016 errors (public APIs must be declared).editorconfig
file to suppress RS0016 (see diff below)I took a quick stab at debugging. A few observations:
CSharpDiagnosticFilter.GetDiagnosticReport
has a parameterSyntaxTreeOptionsProvider syntaxTreeOptions
which maps syntax trees with diagnostic options from editorconfig, but the source-generated syntax trees are missing from the map.CommonCompiler.RunCore
prepares that map (localsourceFileAnalyzerConfigOptions
) before we run the generators inCompileAndEmit
but that map doesn't get updated to account for source-generated syntax treesWe encountered this problem here: #51299 (review)
The text was updated successfully, but these errors were encountered: