qmljs: Make the QMLJsPluginDumper asynchronous to avoid eventloop hangs

Change-Id: I3f6e6acaaf3781d86a0fa5fb100219f92b70f0b5
Fixes: QTCREATORBUG-20243
Task-number: QTCREATORBUG-18533
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
This commit is contained in:
Philip Van Hoof
2020-04-17 11:40:42 +02:00
parent b1352fb044
commit ba171172e4
2 changed files with 182 additions and 102 deletions

View File

@@ -71,18 +71,30 @@ private:
QStringList typeInfoPaths;
};
class QmlTypeDescription {
public:
QStringList errors;
QStringList warnings;
QList<LanguageUtils::FakeMetaObject::ConstPtr> objects;
QList<ModuleApiInfo> moduleApis;
QStringList dependencies;
};
class DependencyInfo {
public:
QStringList errors;
QStringList warnings;
QList<LanguageUtils::FakeMetaObject::ConstPtr> objects;
};
void runQmlDump(const QmlJS::ModelManagerInterface::ProjectInfo &info, const QStringList &arguments, const QString &importPath);
void dump(const Plugin &plugin);
void loadQmlTypeDescription(const QStringList &path, QStringList &errors, QStringList &warnings,
QList<LanguageUtils::FakeMetaObject::ConstPtr> &objects,
QList<ModuleApiInfo> *moduleApi,
QStringList *dependencies) const;
QFuture<QmlTypeDescription> loadQmlTypeDescription(const QStringList &path) const;
QString buildQmltypesPath(const QString &name) const;
void loadDependencies(const QStringList &dependencies,
QStringList &errors,
QStringList &warnings,
QList<LanguageUtils::FakeMetaObject::ConstPtr> &objects,
QSet<QString> *visited = nullptr) const;
QFuture<PluginDumper::DependencyInfo> loadDependencies(const QStringList &dependencies,
QSharedPointer<QSet<QString>> visited) const;
void loadQmltypesFile(const QStringList &qmltypesFilePaths,
const QString &libraryPath,
QmlJS::LibraryInfo libraryInfo);