QmlJS: Add semantic highlighting.

Change-Id: If9293244075cff1a52801b50cdbb77248ecd21ea
Reviewed-on: http://codereview.qt.nokia.com/3310
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
Christian Kamm
2011-08-16 09:47:54 +02:00
parent 1b9af316a0
commit c105ae47c1
20 changed files with 865 additions and 141 deletions

View File

@@ -56,6 +56,20 @@ QList<const QmlComponentChain *> QmlComponentChain::instantiatingComponents() co
return m_instantiatingComponents;
}
const ObjectValue *QmlComponentChain::idScope() const
{
if (!m_document)
return 0;
return m_document->bind()->idEnvironment();
}
const ObjectValue *QmlComponentChain::rootObjectScope() const
{
if (!m_document)
return 0;
return m_document->bind()->rootObjectValue();
}
void QmlComponentChain::addInstantiatingComponent(const QmlComponentChain *component)
{
m_instantiatingComponents.append(component);
@@ -188,9 +202,9 @@ static void collectScopes(const QmlComponentChain *chain, QList<const ObjectValu
if (!chain->document())
return;
if (ObjectValue *root = chain->document()->bind()->rootObjectValue())
if (const ObjectValue *root = chain->rootObjectScope())
target->append(root);
if (ObjectValue *ids = chain->document()->bind()->idEnvironment())
if (const ObjectValue *ids = chain->idScope())
target->append(ids);
}
@@ -294,4 +308,3 @@ void ScopeChain::makeComponentChain(
}
}
}

View File

@@ -58,6 +58,9 @@ public:
Document::Ptr document() const;
QList<const QmlComponentChain *> instantiatingComponents() const;
const ObjectValue *idScope() const;
const ObjectValue *rootObjectScope() const;
// takes ownership
void addInstantiatingComponent(const QmlComponentChain *component);