Commit 09bf431a authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Fixed jump to the matching definition.

parent 8ecbb441
...@@ -742,14 +742,17 @@ Symbol *Snapshot::findMatchingDefinition(Symbol *symbol) const ...@@ -742,14 +742,17 @@ Symbol *Snapshot::findMatchingDefinition(Symbol *symbol) const
QList<Function *> viableFunctions; QList<Function *> viableFunctions;
ClassOrNamespace *enclosingType = context.lookupType(declaration);
if (! enclosingType)
continue; // nothing to do
foreach (Function *fun, result) { foreach (Function *fun, result) {
const QList<Symbol *> declarations = context.lookup(fun->name(), fun->scope()); const QList<Symbol *> declarations = context.lookup(fun->name(), fun->scope());
if (declarations.isEmpty())
continue;
if (declarations.contains(declaration)) else if (enclosingType == context.lookupType(declarations.first()))
viableFunctions.append(fun); viableFunctions.append(fun);
else if (false)
qDebug() << "does not contain" << declaration->fileName() << declaration->line() << declaration->column();
} }
if (viableFunctions.isEmpty()) if (viableFunctions.isEmpty())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment