forked from qt-creator/qt-creator
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user