Fix method parameters: 'in', 'out' and 'ref' (#17)

* Fix Ref and Out

* _
This commit is contained in:
Stef Heyenrath
2021-07-27 18:47:00 +02:00
committed by GitHub
parent 6061728250
commit e6724dd457
6 changed files with 227 additions and 6 deletions
@@ -5,6 +5,24 @@ namespace ProxyInterfaceSourceGenerator.Extensions
{
internal static class SymbolExtensions
{
public static string GetRefPrefix(this IParameterSymbol ps)
{
switch (ps.RefKind)
{
case RefKind.In:
return "in ";
case RefKind.Out:
return "out ";
case RefKind.Ref:
return "ref ";
default:
return string.Empty;
}
}
public static string GetParamsPrefix(this IParameterSymbol ps)
{
return ps.IsParams ? "params " : string.Empty;