Fixes for scope range calculation.

This commit is contained in:
Erik Verbruggen
2010-07-19 10:42:07 +02:00
parent 7de836bf85
commit 867bf3dae8
9 changed files with 114 additions and 55 deletions

View File

@@ -87,12 +87,12 @@ public:
static Scope *findScope(unsigned tokenOffset, const QList<ScopedSymbol *> &scopes)
{
for (int i = scopes.size() - 1; i != -1; --i) {
ScopedSymbol *symbol = scopes.at(i);
const unsigned start = symbol->startOffset();
const unsigned end = symbol->endOffset();
Scope *scope = scopes.at(i)->members();
const unsigned start = scope->startOffset();
const unsigned end = scope->endOffset();
if (tokenOffset >= start && tokenOffset < end)
return symbol->members();
return scope;
}
return 0;