Fixed the global completion to include the injected class name and user types.

This commit is contained in:
Roberto Raggi
2010-06-02 13:59:01 +02:00
parent f579e266e1
commit ffa66f4fb5

View File

@@ -941,7 +941,7 @@ void CppCodeCompletion::globalCompletion(Scope *currentScope)
if (symbols.first()->isNamespace()) if (symbols.first()->isNamespace())
completeNamespace(currentBinding); completeNamespace(currentBinding);
else else
completeClass(currentBinding, false); completeClass(currentBinding);
} }
} }
@@ -1440,6 +1440,8 @@ void CppCodeCompletion::completeClass(ClassOrNamespace *b, bool staticLookup)
scopesVisited.insert(scope); scopesVisited.insert(scope);
addCompletionItem(scope->owner()); // add a completion item for the injected class name.
for (Scope::iterator it = scope->firstSymbol(); it != scope->lastSymbol(); ++it) { for (Scope::iterator it = scope->firstSymbol(); it != scope->lastSymbol(); ++it) {
Symbol *member = *it; Symbol *member = *it;
if (member->isFriend()) if (member->isFriend())