add field and property doc comments

This commit is contained in:
Matt Parker
2025-10-12 11:29:13 +10:00
parent 2e8fc663fe
commit ea4240cb13
3 changed files with 11 additions and 5 deletions

View File

@@ -410,10 +410,10 @@ public static partial class SymbolInfoComponents
}
private static readonly Color HrColour = new Color("4d4d4d");
private static void AddDocs(this RichTextLabel label, IMethodSymbol methodSymbol)
private static void AddDocs(this RichTextLabel label, ISymbol symbol)
{
if (methodSymbol.IsOverride) methodSymbol = methodSymbol.OverriddenMethod!;
var xmlDocs = methodSymbol.GetDocumentationCommentXml();
if (symbol.IsOverride) symbol = symbol.GetOverriddenMember()!;
var xmlDocs = symbol.GetDocumentationCommentXml();
if (string.IsNullOrWhiteSpace(xmlDocs)) return;
label.AddHr(100, 1, HrColour);
label.Newline();

View File

@@ -25,8 +25,11 @@ public static partial class SymbolInfoComponents
label.AddFieldName(symbol);
label.AddText(";");
label.AddContainingNamespaceAndClass(symbol);
label.Newline();
//label.AddTypeParameterArguments(symbol);
label.Pop(); // font
label.AddDocs(symbol);
label.Pop();
label.Pop();
return label;
}

View File

@@ -25,8 +25,11 @@ public partial class SymbolInfoComponents
label.AddPropertyName(symbol);
label.AddGetSetAccessors(symbol);
label.AddContainingNamespaceAndClass(symbol);
label.Newline();
//label.AddTypeParameterArguments(symbol);
label.Pop(); // font
label.AddDocs(symbol);
label.Pop();
label.Pop();
return label;
}