Merged ScopedSymbol and Scope.

This commit is contained in:
Roberto Raggi
2010-08-11 12:26:02 +02:00
parent 5accc9664e
commit 354b9712e4
33 changed files with 500 additions and 818 deletions

View File

@@ -68,15 +68,14 @@ QString AbstractEditorSupport::functionAt(const CppModelManagerInterface *modelM
return QString();
if (const CPlusPlus::Symbol *symbol = document->lastVisibleSymbolAt(line, column))
if (const CPlusPlus::Scope *scope = symbol->scope())
if (const CPlusPlus::Scope *functionScope = scope->enclosingPrototypeScope())
if (const CPlusPlus::Symbol *function = functionScope->owner()) {
if (const CPlusPlus::Scope *functionScope = scope->enclosingFunction())
if (const CPlusPlus::Symbol *function = functionScope) {
const CPlusPlus::Overview o;
QString rc = o.prettyName(function->name());
// Prepend namespace "Foo::Foo::foo()" up to empty root namespace
for (const CPlusPlus::Symbol *owner = function; ; ) {
if (const CPlusPlus::Scope *nameSpace = owner->enclosingNamespaceScope()) {
owner = nameSpace->owner();
const QString name = o.prettyName(owner->name());
if (const CPlusPlus::Scope *nameSpace = owner->enclosingNamespace()) {
const QString name = o.prettyName(nameSpace->name());
if (name.isEmpty()) {
break;
} else {