Skip to content

Commit

Permalink
Merge pull request #436 from JakenVeina/master
Browse files Browse the repository at this point in the history
Visual Studio Project Template: "Analyzer with Code Fix": Verifier does not properly account for multiple source files
  • Loading branch information
jmarolf authored Feb 4, 2020
2 parents ae4c535 + 01fc349 commit f2afcfa
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Text;
Expand Down Expand Up @@ -92,7 +92,10 @@ protected static Diagnostic[] GetSortedDiagnosticsFromDocuments(DiagnosticAnalyz
/// <returns>An IEnumerable containing the Diagnostics in order of Location</returns>
private static Diagnostic[] SortDiagnostics(IEnumerable<Diagnostic> diagnostics)
{
return diagnostics.OrderBy(d => d.Location.SourceSpan.Start).ToArray();
return diagnostics
.OrderBy(d => d.Location.SourceTree.FilePath)
.ThenBy(d => d.Location.SourceSpan.Start)
.ToArray();
}

#endregion
Expand Down

0 comments on commit f2afcfa

Please sign in to comment.