Skip to content
Snippets Groups Projects
Commit 1cbee8cd authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Fixed EnumerateProperties to enumerate properties of the base object.

Done with: ckamm
parent 038b7582
No related branches found
No related tags found
No related merge requests found
......@@ -143,16 +143,24 @@ public:
_globalCompletion = globalCompletion;
}
QHash<QString, const Interpreter::Value *> operator ()(bool lookAtScope = false)
QHash<QString, const Interpreter::Value *> operator ()(const Interpreter::Value *value)
{
_processed.clear();
_properties.clear();
if (!lookAtScope) {
enumerateProperties(_link->scopeChain().first());
} else {
foreach (const Interpreter::ObjectValue *scope, _link->scopeChain())
enumerateProperties(scope);
}
enumerateProperties(value);
return _properties;
}
QHash<QString, const Interpreter::Value *> operator ()()
{
_processed.clear();
_properties.clear();
foreach (const Interpreter::ObjectValue *scope, _link->scopeChain())
enumerateProperties(scope);
return _properties;
}
......@@ -650,7 +658,7 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
// It's a global completion.
EnumerateProperties enumerateProperties(&link);
enumerateProperties.setGlobalCompletion(true);
QHashIterator<QString, const Interpreter::Value *> it(enumerateProperties(/* lookAtScope = */ true));
QHashIterator<QString, const Interpreter::Value *> it(enumerateProperties());
while (it.hasNext()) {
it.next();
......@@ -679,7 +687,7 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
if (value && completionOperator == QLatin1Char('.')) { // member completion
EnumerateProperties enumerateProperties(&link);
QHashIterator<QString, const Interpreter::Value *> it(enumerateProperties());
QHashIterator<QString, const Interpreter::Value *> it(enumerateProperties(value));
while (it.hasNext()) {
it.next();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment