Skip to content

Commit

Permalink
Merge pull request #51696 from Youssef1313/analyzer-report
Browse files Browse the repository at this point in the history
Show diagnostic ids in analyzer report
  • Loading branch information
jmarolf authored Mar 5, 2021
2 parents 628d74c + 8c95cfc commit f2d3bd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9151,7 +9151,7 @@ public void ReportAnalyzerOutput()
Assert.Equal(0, exitCode);
var output = outWriter.ToString();
Assert.Contains(CodeAnalysisResources.AnalyzerExecutionTimeColumnHeader, output, StringComparison.Ordinal);
Assert.Contains(new WarningDiagnosticAnalyzer().ToString(), output, StringComparison.Ordinal);
Assert.Contains("WarningDiagnosticAnalyzer (Warning01)", output, StringComparison.Ordinal);
CleanupAllGeneratedFiles(srcFile.Path);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Compilers/Core/Portable/CommandLine/CommonCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,8 @@ private static void ReportAnalyzerExecutionTime(TextWriter consoleOutput, Analyz

analyzerTimeColumn = getFormattedTime(executionTime);
analyzerPercentageColumn = getFormattedPercentage(percentage);
analyzerNameColumn = getFormattedAnalyzerName(" " + kvp.Key.ToString());
var analyzerIds = string.Join(", ", kvp.Key.SupportedDiagnostics.Select(d => d.Id).Distinct().OrderBy(id => id));
analyzerNameColumn = getFormattedAnalyzerName($" {kvp.Key} ({analyzerIds})");

consoleOutput.WriteLine(analyzerTimeColumn + analyzerPercentageColumn + analyzerNameColumn);
}
Expand Down

0 comments on commit f2d3bd1

Please sign in to comment.