Browse Source

Fix navigating to methods in DecompiledViewContent.

newNRvisualizers
Daniel Grunwald 13 years ago
parent
commit
143663b0f3
  1. 5
      src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs
  2. 10
      src/Libraries/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs

5
src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs

@ -13,6 +13,7 @@ using ICSharpCode.Decompiler.Ast; @@ -13,6 +13,7 @@ using ICSharpCode.Decompiler.Ast;
using ICSharpCode.ILSpyAddIn.LaunchILSpy;
using ICSharpCode.ILSpyAddIn.ViewContent;
using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Bookmarks;
using ICSharpCode.SharpDevelop.Debugging;
@ -47,7 +48,7 @@ namespace ICSharpCode.ILSpyAddIn @@ -47,7 +48,7 @@ namespace ICSharpCode.ILSpyAddIn
#region Constructor
public DecompiledViewContent(FileName assemblyFile, string fullTypeName, string entityTag)
{
this.virtualFileName = FileName.Create("ilspy://" + assemblyFile + ">" + fullTypeName);
this.virtualFileName = FileName.Create("ilspy://" + assemblyFile + "/" + fullTypeName);
this.codeView = new CodeView();
this.assemblyFile = assemblyFile;
@ -55,7 +56,7 @@ namespace ICSharpCode.ILSpyAddIn @@ -55,7 +56,7 @@ namespace ICSharpCode.ILSpyAddIn
this.jumpToEntityIdStringWhenDecompilationFinished = entityTag;
string shortTypeName = fullTypeName.Substring(fullTypeName.LastIndexOf('.') + 1);
this.TitleName = "[" + shortTypeName + "]";
this.TitleName = "[" + ReflectionHelper.SplitTypeParameterCountFromReflectionName(shortTypeName) + "]";
Thread thread = new Thread(DecompilationThread);
thread.Name = "Decompiler (" + shortTypeName + ")";

10
src/Libraries/ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs

@ -150,13 +150,11 @@ namespace ICSharpCode.Decompiler.Ast @@ -150,13 +150,11 @@ namespace ICSharpCode.Decompiler.Ast
return null;
var node = nodeStack.Peek();
if (node is Identifier)
node = node.Parent;
if (IsDefinition(node))
return node.Annotation<MemberReference>();
var fieldDef = node.Parent.Annotation<FieldDefinition>();
if (fieldDef != null)
return node.Parent.Annotation<MemberReference>();
return null;
}
@ -332,7 +330,9 @@ namespace ICSharpCode.Decompiler.Ast @@ -332,7 +330,9 @@ namespace ICSharpCode.Decompiler.Ast
private static bool IsDefinition(AstNode node)
{
return node is EntityDeclaration;
return node is EntityDeclaration
|| (node is VariableInitializer && node.Parent is FieldDeclaration)
|| node is FixedVariableInitializer;
}
}
}

Loading…
Cancel
Save