Commit f0c32d79 authored by Christian Kamm's avatar Christian Kamm
Browse files

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: default avatarFawzi Mohamed <fawzi.mohamed@nokia.com>
parent 8fe33023
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment