QmlDesigner: Skip makeComponentChain in TextToModelMerger::load

This is not required in the context of QmlDesigner and can become
very slow.

Change-Id: Id4a4ae30c5fa55e88ed295624365efb724e26f62
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Thomas Hartmann
2023-01-31 16:02:26 +01:00
parent 4108ba874a
commit 0198ed15f3
3 changed files with 17 additions and 0 deletions

View File

@@ -11,6 +11,8 @@
using namespace QmlJS;
bool ScopeChain::s_setSkipmakeComponentChain = false;
/*!
\class QmlJS::ScopeChain
\brief The ScopeChain class describes the scopes used for global lookup in
@@ -210,6 +212,11 @@ QList<const ObjectValue *> ScopeChain::all() const
return m_all;
}
void ScopeChain::setSkipmakeComponentChain(bool b)
{
s_setSkipmakeComponentChain = b;
}
static void collectScopes(const QmlComponentChain *chain, QList<const ObjectValue *> *target)
{
foreach (const QmlComponentChain *parent, chain->instantiatingComponents())
@@ -351,6 +358,9 @@ void ScopeChain::makeComponentChain(
const Snapshot &snapshot,
QHash<const Document *, QmlComponentChain *> *components)
{
if (s_setSkipmakeComponentChain)
return;
Document::Ptr doc = target->document();
if (!doc->qmlProgram())
return;

View File

@@ -77,6 +77,8 @@ public:
QList<const ObjectValue *> all() const;
static void setSkipmakeComponentChain(bool b);
private:
void update() const;
void initializeRootScope();
@@ -97,6 +99,8 @@ private:
mutable bool m_modified;
mutable QList<const ObjectValue *> m_all;
static bool s_setSkipmakeComponentChain;
};
} // namespace QmlJS