dotnet/roslyn

Remove or document "CompilerDiagnostic" type

Aperta

#63.938 aperta il 12 set 2022

 (0 commenti) (0 reazioni) (0 assegnatari)C# (4257 fork)batch import
Area-AnalyzersConcept-Continuous Improvementhelp wanted

Metriche repository

Star
 (20.414 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor