QmlJS: Refactor LookupContext creation for speed.

* If possible, create LookupContexts through SemanticInfo; it caches the
  linked Context and will be faster.
* Contexts now own their Engine.

Reviewed-by: Lasse Holmstedt
This commit is contained in:
Christian Kamm
2010-08-26 10:50:00 +02:00
parent af46c3d947
commit 87e04df257
15 changed files with 141 additions and 96 deletions

View File

@@ -691,7 +691,7 @@ int CodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
const QIcon keywordIcon = iconForColor(Qt::darkYellow);
const QList<AST::Node *> path = semanticInfo.astPath(editor->position());
LookupContext::Ptr lookupContext = LookupContext::create(document, snapshot, path);
LookupContext::Ptr lookupContext = semanticInfo.lookupContext(path);
const Interpreter::Context *context = lookupContext->context();
// Search for the operator that triggered the completion.