QmlJS: Provide good completion for PropertyChanges with a target again.

Task-number: QTCREATORBUG-1413
Reviewed-by: Erik Verbruggen
This commit is contained in:
Christian Kamm
2010-05-19 11:15:57 +02:00
parent 735f908382
commit 088bdb29db
3 changed files with 26 additions and 8 deletions

View File

@@ -38,6 +38,7 @@
#include <qmljs/qmljsscanner.h>
#include <qmljs/qmljsevaluate.h>
#include <qmljs/qmljscompletioncontextfinder.h>
#include <qmljs/qmljsscopebuilder.h>
#include <texteditor/basetexteditor.h>
@@ -687,6 +688,11 @@ int CodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
addCompletions(enumerateProperties(qmlScopeType), symbolIcon);
addCompletions(enumerateProperties(context.scopeChain().qmlTypes), symbolIcon);
if (ScopeBuilder::isPropertyChangesObject(&context, qmlScopeType)
&& context.scopeChain().qmlScopeObjects.size() == 2) {
addCompletions(enumerateProperties(context.scopeChain().qmlScopeObjects.first()), symbolIcon);
}
}
if (contextFinder.isInRhsOfBinding() && qmlScopeType) {