This commit is contained in:
Roberto Raggi
2010-02-02 10:47:07 +01:00
parent 53d1eba3f7
commit 4bb0e85cfe

View File

@@ -616,11 +616,9 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
m_completions.clear();
SemanticInfo semanticInfo = edit->semanticInfo();
const SemanticInfo semanticInfo = edit->semanticInfo();
const QmlJS::Snapshot snapshot = semanticInfo.snapshot;
Document::Ptr qmlDocument = semanticInfo.document;
if (qmlDocument.isNull())
return -1;
const Document::Ptr qmlDocument = semanticInfo.document;
const QFileInfo currentFileInfo(fileName);
@@ -635,7 +633,7 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
// Set up the current scope chain.
Interpreter::ObjectValue *scope = interp.globalObject();
if (isQmlFile) {
if (isQmlFile && qmlDocument) {
AST::UiObjectMember *declaringMember = semanticInfo.declaringMember(editor->position());
scope = Bind::scopeChainAt(qmlDocument, snapshot, &interp, declaringMember);
}