QmlJS: Don't try to complete slots in lhs of binding.

Task-number: QTCREATORBUG-3459
Change-Id: I694391bf7ccddcaa539ec4ed2b744e875cc43f38
Reviewed-on: http://codereview.qt.nokia.com/626
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
Christian Kamm
2011-06-22 16:26:35 +02:00
parent 8fe3302329
commit f0c32d79ba

View File

@@ -84,6 +84,7 @@ class EnumerateProperties: private Interpreter::MemberProcessor
QHash<QString, const Interpreter::Value *> _properties;
bool _globalCompletion;
bool _enumerateGeneratedSlots;
bool _enumerateSlots;
const Interpreter::Context *_context;
const Interpreter::ObjectValue *_currentObject;
@@ -91,6 +92,7 @@ public:
EnumerateProperties(const Interpreter::Context *context)
: _globalCompletion(false),
_enumerateGeneratedSlots(false),
_enumerateSlots(true),
_context(context),
_currentObject(0)
{
@@ -106,6 +108,11 @@ public:
_enumerateGeneratedSlots = enumerate;
}
void setEnumerateSlots(bool enumerate)
{
_enumerateSlots = enumerate;
}
QHash<QString, const Interpreter::Value *> operator ()(const Interpreter::Value *value)
{
_processed.clear();
@@ -155,7 +162,8 @@ private:
virtual bool processSlot(const QString &name, const Interpreter::Value *value)
{
insertProperty(name, value);
if (_enumerateSlots)
insertProperty(name, value);
return true;
}
@@ -494,6 +502,7 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const IAssistInterface
EnumerateProperties enumerateProperties(context);
enumerateProperties.setGlobalCompletion(true);
enumerateProperties.setEnumerateGeneratedSlots(true);
enumerateProperties.setEnumerateSlots(false);
// id: is special
BasicProposalItem *idProposalItem = new QmlJSAssistProposalItem;