Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(xml): better error when link not found #9957

Merged
merged 5 commits into from
May 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/Docfx.Dotnet/Parsers/XmlComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,17 @@ private void ResolveCrefLink(XNode node, string nodeSelector, Action<string, str
}
}

Logger.Log(LogLevel.Warning, $"Invalid cref value \"{cref}\" found in XML documentation comment {detailedInfo}.", code: "InvalidCref");
if (detailedInfo.Length == 0 && node is XDocument doc)
{
var memberName = (string) doc.Element("member")?.Attribute("name");

if (! string.IsNullOrEmpty(memberName))
{
detailedInfo.Append(", member name is ");
detailedInfo.Append(memberName);
} }
Patrick8639 marked this conversation as resolved.
Show resolved Hide resolved

Logger.Log(LogLevel.Warning, $"Invalid cref value \"{cref}\" found in XML documentation comment{detailedInfo}.", code: "InvalidCref");
yufeih marked this conversation as resolved.
Show resolved Hide resolved

if (cref.StartsWith("!:"))
{
Expand Down
Loading