390093d007
* wip * . * method * TT * TT * . * . * mp
14 lines
611 B
C#
14 lines
611 B
C#
using System.Linq;
|
|
using Microsoft.CodeAnalysis;
|
|
|
|
namespace ProxyInterfaceSourceGenerator.Extensions
|
|
{
|
|
internal static class MethodSymbolExtensions
|
|
{
|
|
public static string GetMethodNameWithOptionalTypeParameters(this IMethodSymbol method) =>
|
|
!method.IsGenericMethod ? method.Name : $"{method.Name}<{string.Join(", ", method.TypeParameters.Select(tp => tp.Name))}>";
|
|
|
|
public static string GetWhereStatement(this IMethodSymbol method) =>
|
|
!method.IsGenericMethod ? string.Empty : string.Join("", method.TypeParameters.Select(tp => tp.GetWhereStatement()));
|
|
}
|
|
} |