From fa5ec2707231f910c952df2a391833451079757f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Wed, 7 Dec 2011 11:50:27 +0100 Subject: [PATCH] Resolve object create expression, if the parent is one. That causes a jump/tooltip for the constructor rather than the class on a object create expression. --- ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs b/ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs index 4b1a0b1ad1..5f1f7800ed 100644 --- a/ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs +++ b/ICSharpCode.NRefactory.CSharp/Resolver/ResolveAtLocation.cs @@ -58,6 +58,10 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver return null; } + if (resolvableNode != null && resolvableNode.Parent is ObjectCreateExpression) { + resolvableNode = resolvableNode.Parent; + } + InvocationExpression parentInvocation = null; if ((resolvableNode is IdentifierExpression || resolvableNode is MemberReferenceExpression || resolvableNode is PointerReferenceExpression)) { // we also need to resolve the invocation