Jump at the function's definition.

This commit is contained in:
Roberto Raggi
2010-05-14 09:11:05 +02:00
parent 5d13a206e2
commit 1302de086a
2 changed files with 3 additions and 6 deletions

View File

@@ -555,6 +555,7 @@ bool ResolveExpression::visit(MemberAccessAST *ast)
// The candidate types for the base expression are stored in // The candidate types for the base expression are stored in
// _results. // _results.
const QList<LookupItem> baseResults = _results; const QList<LookupItem> baseResults = _results;
_results.clear();
// Evaluate the expression-id that follows the access operator. // Evaluate the expression-id that follows the access operator.
const Name *memberName = 0; const Name *memberName = 0;

View File

@@ -1427,7 +1427,7 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
TypeOfExpression typeOfExpression; TypeOfExpression typeOfExpression;
typeOfExpression.init(doc, snapshot); typeOfExpression.init(doc, snapshot);
QList<LookupItem> resolvedSymbols = typeOfExpression(expression, scope, TypeOfExpression::Preprocess); const QList<LookupItem> resolvedSymbols = typeOfExpression(expression, scope, TypeOfExpression::Preprocess);
if (!resolvedSymbols.isEmpty()) { if (!resolvedSymbols.isEmpty()) {
const LookupItem result = skipForwardDeclarations(resolvedSymbols); const LookupItem result = skipForwardDeclarations(resolvedSymbols);
@@ -1435,12 +1435,8 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
if (Symbol *symbol = result.declaration()) { if (Symbol *symbol = result.declaration()) {
Symbol *def = 0; Symbol *def = 0;
qWarning() << "find definition?"; if (resolveTarget)
#warning port me
#if 0
if (resolveTarget && !lastSymbol->isFunction())
def = findDefinition(symbol, snapshot); def = findDefinition(symbol, snapshot);
#endif
link = linkToSymbol(def ? def : symbol); link = linkToSymbol(def ? def : symbol);
link.begin = beginOfToken; link.begin = beginOfToken;