未验证 提交 970a768f 编写于 作者: H Heejae Chang 提交者: GitHub

change build errors to show up at the end rather than at the top. (#31214)

上级 38cc7ab5
...@@ -391,8 +391,23 @@ private ErrorRank GetErrorRank(DiagnosticData item) ...@@ -391,8 +391,23 @@ private ErrorRank GetErrorRank(DiagnosticData item)
switch (value) switch (value)
{ {
case WellKnownDiagnosticTags.Build: case WellKnownDiagnosticTags.Build:
// any error from build is highest priority // any error from build gets lowest priority
return ErrorRank.Lexical; // 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): case nameof(ErrorRank.Lexical):
return ErrorRank.Lexical; return ErrorRank.Lexical;
case nameof(ErrorRank.Syntactic): case nameof(ErrorRank.Syntactic):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册