From 1302de086ab25a0c407ec2b628f3be473fdf355f Mon Sep 17 00:00:00 2001 From: Roberto Raggi <roberto.raggi@nokia.com> Date: Fri, 14 May 2010 09:11:05 +0200 Subject: [PATCH] Jump at the function's definition. --- src/libs/cplusplus/ResolveExpression.cpp | 1 + src/plugins/cppeditor/cppeditor.cpp | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp index b3012b2096d..2c333910e3f 100644 --- a/src/libs/cplusplus/ResolveExpression.cpp +++ b/src/libs/cplusplus/ResolveExpression.cpp @@ -555,6 +555,7 @@ bool ResolveExpression::visit(MemberAccessAST *ast) // The candidate types for the base expression are stored in // _results. const QList<LookupItem> baseResults = _results; + _results.clear(); // Evaluate the expression-id that follows the access operator. const Name *memberName = 0; diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 579be85360c..76a265b67e8 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -1427,7 +1427,7 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor, TypeOfExpression typeOfExpression; typeOfExpression.init(doc, snapshot); - QList<LookupItem> resolvedSymbols = typeOfExpression(expression, scope, TypeOfExpression::Preprocess); + const QList<LookupItem> resolvedSymbols = typeOfExpression(expression, scope, TypeOfExpression::Preprocess); if (!resolvedSymbols.isEmpty()) { const LookupItem result = skipForwardDeclarations(resolvedSymbols); @@ -1435,12 +1435,8 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor, if (Symbol *symbol = result.declaration()) { Symbol *def = 0; - qWarning() << "find definition?"; -#warning port me -#if 0 - if (resolveTarget && !lastSymbol->isFunction()) + if (resolveTarget) def = findDefinition(symbol, snapshot); -#endif link = linkToSymbol(def ? def : symbol); link.begin = beginOfToken; -- GitLab