From 970a768f3b51d2da4c35ead49cd6508b02e0b332 Mon Sep 17 00:00:00 2001 From: Heejae Chang Date: Sat, 17 Nov 2018 01:33:11 -0800 Subject: [PATCH] change build errors to show up at the end rather than at the top. (#31214) --- ...DiagnosticListTable.LiveTableDataSource.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/VisualStudio/Core/Def/Implementation/TableDataSource/VisualStudioBaseDiagnosticListTable.LiveTableDataSource.cs b/src/VisualStudio/Core/Def/Implementation/TableDataSource/VisualStudioBaseDiagnosticListTable.LiveTableDataSource.cs index 43e79fa3003..91368de37b0 100644 --- a/src/VisualStudio/Core/Def/Implementation/TableDataSource/VisualStudioBaseDiagnosticListTable.LiveTableDataSource.cs +++ b/src/VisualStudio/Core/Def/Implementation/TableDataSource/VisualStudioBaseDiagnosticListTable.LiveTableDataSource.cs @@ -391,8 +391,23 @@ private ErrorRank GetErrorRank(DiagnosticData item) switch (value) { case WellKnownDiagnosticTags.Build: - // any error from build is highest priority - return ErrorRank.Lexical; + // any error from build gets lowest priority + // see https://github.com/dotnet/roslyn/issues/28807 + // + // this is only used when intellisense (live) errors are involved. + // with "build only" filter on, we use order of errors came in from build for ordering + // and doesn't use ErrorRank for ordering (by giving same rank for all errors) + // + // when live errors are involved, by default, error list will use the following to sort errors + // error rank > project rank > project name > file name > line > column + // which will basically make syntax errors show up before declaration error and method body semantic errors + // among same type of errors, leaf project's error will show up first and then projects that depends on the leaf projects + // + // any build errors mixed with live errors will show up at the end. when live errors are on, some of errors + // still left as build errors such as errors produced after CompilationStages.Compile or ones listed here + // http://source.roslyn.io/#Microsoft.CodeAnalysis.CSharp/Compilation/CSharpCompilerDiagnosticAnalyzer.cs,23 or similar ones for VB + // and etc. + return ErrorRank.PostBuild; case nameof(ErrorRank.Lexical): return ErrorRank.Lexical; case nameof(ErrorRank.Syntactic): -- GitLab