Skip to content

Commit

Permalink
Treat all compiler errors as unexpected
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Mar 29, 2015
1 parent 2bdf871 commit 746e551
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ protected static async Task<ImmutableArray<Diagnostic>> GetSortedDiagnosticsFrom
{
var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create(analyzer), null, cancellationToken);
var compilerDiagnostics = compilation.GetDiagnostics(cancellationToken);
var compilerErrors = compilerDiagnostics.Where(i => i.Severity == DiagnosticSeverity.Error);
var diags = await compilationWithAnalyzers.GetAnalyzerDiagnosticsAsync().ConfigureAwait(false);
foreach (var diag in diags)
foreach (var diag in diags.Concat(compilerErrors))
{
if (diag.Location == Location.None || diag.Location.IsInMetadata)
{
Expand Down

0 comments on commit 746e551

Please sign in to comment.