Browse Source

[TypeSystem] Specialized method now contains a flag specifying the

extension method mode.
There needs some distinction between extension methods calles foo.Ext
(); and Class.Ext(foo); even if it's the same method call - it's
different for code completion tooltips.
pull/32/merge
Mike Krüger 13 years ago
parent
commit
bd1811cc18
  1. 2
      ICSharpCode.NRefactory.CSharp/Resolver/OverloadResolution.cs
  2. 8
      ICSharpCode.NRefactory/TypeSystem/Implementation/SpecializedMethod.cs

2
ICSharpCode.NRefactory.CSharp/Resolver/OverloadResolution.cs

@ -950,6 +950,8 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver
if (member == null) if (member == null)
throw new InvalidOperationException(); throw new InvalidOperationException();
if (this.IsExtensionMethodInvocation)
((SpecializedMethod)member).IsExtendedExtensionMethod = true;
return new CSharpInvocationResolveResult( return new CSharpInvocationResolveResult(
this.IsExtensionMethodInvocation ? new TypeResolveResult(member.DeclaringType) : targetResolveResult, this.IsExtensionMethodInvocation ? new TypeResolveResult(member.DeclaringType) : targetResolveResult,
member, member,

8
ICSharpCode.NRefactory/TypeSystem/Implementation/SpecializedMethod.cs

@ -153,6 +153,14 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
accessorOwner = value; accessorOwner = value;
} }
} }
/// <summary>
/// Gets/Sets whether the method is an extension method that are being called using extension method syntax.
/// </summary>
public bool IsExtendedExtensionMethod {
get;
set;
}
public override IMemberReference ToMemberReference() public override IMemberReference ToMemberReference()
{ {

Loading…
Cancel
Save