Add support for generics (#20)

* wip

* .

* method

* TT

* TT

* .

* .

* mp
This commit is contained in:
Stef Heyenrath
2021-08-01 10:34:25 +02:00
committed by GitHub
parent 296988b13f
commit 390093d007
18 changed files with 322 additions and 169 deletions
@@ -0,0 +1,14 @@
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()));
}
}