dotnet/roslyn

Remove or document "CompilerDiagnostic" type

Open

#63,938 opened on Sep 12, 2022

View on GitHub
 (0 comments) (0 reactions) (0 assignees)C# (4,257 forks)batch import
Area-AnalyzersConcept-Continuous Improvementhelp wanted

Repository metrics

Stars
 (20,414 stars)
PR merge metrics
 (Avg merge 6d 17h) (256 merged PRs in 30d)

Description

See https://github.com/dotnet/roslyn/pull/63937 for details

For compiler diagnostics which have a non-null property bag attached to it, the CompilerDiagnosticAnalyzer reports a wrapping CompilerDiagnostic: https://github.com/dotnet/roslyn/blob/c71fa5419aa035a8d76c8a82387353e3892180a7/src/Compilers/Core/Portable/DiagnosticAnalyzer/CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs#L70-L71

I do not have historical context on why we report this wrapping CompilerDiagnostic in presence of a non-null property bag on the diagnostic. We may want to consider experimenting removing this type and verify what, if anything, breaks. At the minimum, we should document the reason behind this wrapping diagnostic. I'll file a tracking issue for this work.

Contributor guide