Skip to content

Commit

Permalink
chore: Improve unresolved xref messages (dotnet#9884)
Browse files Browse the repository at this point in the history
chore: improve unresolved xref message
  • Loading branch information
filzrev authored and p-kostov committed Jun 28, 2024
1 parent c70bd9b commit c99a687
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private static void LogInvalidXRefs(List<XRefDetails> unresolvedXRefs)
foreach (var group in unresolvedXRefs.GroupBy(i => i.SourceFile))
{
// For each source file, print the first 10 invalid cross reference
var details = group.Take(MaxInvalidXrefMessagePerFile).Select(i => $"\"{HttpUtility.HtmlDecode(i.RawSource)}\" in line {i.SourceStartLineNumber}").Distinct().ToList();
var details = group.Take(MaxInvalidXrefMessagePerFile).Select(i => $"\"{HttpUtility.HtmlDecode(i.RawSource ?? i.Uid)}\" in line {i.SourceStartLineNumber}").Distinct().ToList();
var prefix = details.Count > MaxInvalidXrefMessagePerFile ? $"top {MaxInvalidXrefMessagePerFile} " : string.Empty;
var message = $"Details for {prefix}invalid cross reference(s): {details.ToDelimitedString(", ")}";

Expand Down

0 comments on commit c99a687

Please sign in to comment.