forked from qt-creator/qt-creator
QmlJS: Fix scoping for non-js files without scope objects.
For instance the Connections and ListModel elements have their scope objects cleared but should still see the instantiating component chain. Change-Id: I6fe48d77e4a99bbae2b7faa3ed38669832ccaa6a Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
@@ -259,7 +259,7 @@ void ScopeChain::update() const
|
||||
m_all += m_cppContextProperties;
|
||||
|
||||
// the root scope in js files doesn't see instantiating components
|
||||
if (m_jsScopes.count() != 1 || !m_qmlScopeObjects.isEmpty()) {
|
||||
if (m_document->language() != Document::JavaScriptLanguage || m_jsScopes.count() != 1) {
|
||||
if (m_qmlComponentScope) {
|
||||
foreach (const QmlComponentChain *parent, m_qmlComponentScope->instantiatingComponents())
|
||||
collectScopes(parent, &m_all);
|
||||
|
||||
Reference in New Issue
Block a user