Commit 345909a5 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Fixed: Completion doesn't work for typedefs

Task-number: QTCREATORBUG-170
parent aceeea96
......@@ -639,10 +639,19 @@ ResolveExpression::resolveBaseExpression(const QList<Result> &baseResults, int a
}
}
if (ty->isNamedType())
if (NamedType *namedTy = ty->asNamedType()) {
const QList<Scope *> visibleScopes = _context.visibleScopes(result);
const QList<Symbol *> typedefCandidates = _context.resolve(namedTy->name(), visibleScopes);
foreach (Symbol *typedefCandidate, typedefCandidates) {
if (typedefCandidate->isTypedef() && typedefCandidate->type()->isNamedType()) {
ty = typedefCandidate->type();
break;
}
}
results.append(Result(ty, lastVisibleSymbol));
else if (Function *fun = ty->asFunctionType()) {
} else if (Function *fun = ty->asFunctionType()) {
Scope *funScope = fun->scope();
if (funScope && (funScope->isBlockScope() || funScope->isNamespaceScope())) {
......
Supports Markdown
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