Fix the scope chain not being set up correctly for the outermost scope.

This bug manifested itself as not getting a tooltip and correct context
help for the type of the root object in a Qml file.
This commit is contained in:
Christian Kamm
2010-03-10 14:50:56 +01:00
parent e861161af4
commit 4722c6cf84

View File

@@ -73,9 +73,13 @@ void Link::scopeChainAt(Document::Ptr doc, const QList<Node *> &astPath)
scopeChain.jsScopes += bind->rootObjectValue();
}
ScopeBuilder scopeBuilder(doc, _context);
foreach (Node *node, astPath)
scopeBuilder.push(node);
if (astPath.isEmpty()) {
scopeChain.update();
} else {
ScopeBuilder scopeBuilder(doc, _context);
foreach (Node *node, astPath)
scopeBuilder.push(node);
}
}
void Link::makeComponentChain(