Browse Source

Analyzer: result redirection - don't require that name starts with '<'.

Always attempt redirect if member is compiler generated.
pull/170/head
Ed Harvey 14 years ago
parent
commit
5bf46e3d19
  1. 7
      ILSpy/TreeNodes/Analyzer/Helpers.cs

7
ILSpy/TreeNodes/Analyzer/Helpers.cs

@ -63,8 +63,8 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer
public static MethodDefinition GetOriginalCodeLocation(MethodDefinition method) public static MethodDefinition GetOriginalCodeLocation(MethodDefinition method)
{ {
if (method.Name.StartsWith("<", StringComparison.Ordinal) && method.IsCompilerGenerated()) { if (method.IsCompilerGenerated()) {
return FindMethodUsageInType(method.DeclaringType, method); return FindMethodUsageInType(method.DeclaringType, method) ?? method;
} }
var typeUsage = GetOriginalCodeLocation(method.DeclaringType, method); var typeUsage = GetOriginalCodeLocation(method.DeclaringType, method);
@ -73,8 +73,7 @@ namespace ICSharpCode.ILSpy.TreeNodes.Analyzer
} }
public static MethodDefinition GetOriginalCodeLocation(TypeDefinition type, MethodDefinition method) public static MethodDefinition GetOriginalCodeLocation(TypeDefinition type, MethodDefinition method)
{ {
if (type != null && type.DeclaringType != null && if (type != null && type.DeclaringType != null && type.IsCompilerGenerated()) {
type.Name.StartsWith("<", StringComparison.Ordinal) && type.IsCompilerGenerated()) {
MethodDefinition constructor = GetTypeConstructor(type); MethodDefinition constructor = GetTypeConstructor(type);
return FindMethodUsageInType(type.DeclaringType, constructor); return FindMethodUsageInType(type.DeclaringType, constructor);
} }

Loading…
Cancel
Save