[binder] GetRootAssociatedDecl is now an extension method.
This commit is contained in:
Родитель
4e7f9441e2
Коммит
6f15d927fb
|
@ -11,6 +11,14 @@ namespace Embeddinator.Generators
|
||||||
{
|
{
|
||||||
public static class DeclarationExtensions
|
public static class DeclarationExtensions
|
||||||
{
|
{
|
||||||
|
public static Declaration GetRootAssociatedDecl(this Declaration decl)
|
||||||
|
{
|
||||||
|
while (decl.AssociatedDeclaration != null)
|
||||||
|
decl = decl.AssociatedDeclaration;
|
||||||
|
|
||||||
|
return decl;
|
||||||
|
}
|
||||||
|
|
||||||
public static string ManagedQualifiedName(this Declaration decl)
|
public static string ManagedQualifiedName(this Declaration decl)
|
||||||
{
|
{
|
||||||
string managedName;
|
string managedName;
|
||||||
|
|
|
@ -277,19 +277,11 @@ namespace Embeddinator.Generators
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Declaration GetRootAssociatedDecl(Declaration decl)
|
|
||||||
{
|
|
||||||
while (decl.AssociatedDeclaration != null)
|
|
||||||
decl = decl.AssociatedDeclaration;
|
|
||||||
|
|
||||||
return decl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetMethodIdentifier(Method method)
|
public static string GetMethodIdentifier(Method method)
|
||||||
{
|
{
|
||||||
var name = method.Name;
|
var name = method.Name;
|
||||||
|
|
||||||
var associated = GetRootAssociatedDecl(method);
|
var associated = method.GetRootAssociatedDecl();
|
||||||
if (associated.DefinitionOrder != 0)
|
if (associated.DefinitionOrder != 0)
|
||||||
name += $"_{associated.DefinitionOrder}";
|
name += $"_{associated.DefinitionOrder}";
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче