refactor AddType

This commit is contained in:
Matt Parker
2025-10-12 13:29:50 +10:00
parent 81457563be
commit 699135c00e
7 changed files with 18 additions and 28 deletions

View File

@@ -351,6 +351,14 @@ public static partial class SymbolInfoComponents
label.Pop(); // table
}
private static void AddType(this RichTextLabel label, ITypeSymbol symbol)
{
var colour = symbol.GetSymbolColourByType();
label.PushColor(colour);
label.AddText(symbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
label.Pop();
}
// TODO: handle arrays etc, where there are multiple colours in one type
private static Color GetSymbolColourByType(this ITypeSymbol symbol)
{