add async modifier to method tooltip

This commit is contained in:
Matt Parker
2025-10-12 14:38:58 +10:00
parent 0f8df8e0f6
commit 3af14a4b5c

View File

@@ -19,6 +19,7 @@ public static partial class SymbolInfoComponents
label.AddVirtualModifier(methodSymbol);
label.AddAbstractModifier(methodSymbol);
label.AddOverrideModifier(methodSymbol);
label.AddMethodAsyncModifier(methodSymbol);
label.AddMethodReturnType(methodSymbol);
label.AddText(" ");
label.AddMethodName(methodSymbol);
@@ -46,6 +47,17 @@ public static partial class SymbolInfoComponents
}
}
private static void AddMethodAsyncModifier(this RichTextLabel label, IMethodSymbol methodSymbol)
{
if (methodSymbol.IsAsync)
{
label.PushColor(CachedColors.KeywordBlue);
label.AddText("async");
label.Pop();
label.AddText(" ");
}
}
private static void AddMethodReturnType(this RichTextLabel label, IMethodSymbol methodSymbol)
{
if (methodSymbol.ReturnsVoid)