From fa07abf6d89b1fc4693cf634b65718dfa8cb8c95 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 6 May 2024 17:23:29 +0200 Subject: [PATCH] QmlDesigner: Rename ProjectData into DirectoryInfo The design is now directory based. So the name should reflect that. Task-number: QDS-12665 Change-Id: I7479c37357a4fd33f5f3b4c93d63d2fdd4ca6ef9 Reviewed-by: Tim Jenssen Reviewed-by: Reviewed-by: Qt CI Patch Build Bot --- .../projectstorage/projectstorage.cpp | 144 ++-- .../projectstorage/projectstorage.h | 8 +- .../projectstorageexceptions.cpp | 18 +- .../projectstorage/projectstorageexceptions.h | 12 +- .../projectstorage/projectstorageinterface.h | 4 +- .../projectstorage/projectstoragetypes.h | 30 +- .../projectstorage/projectstorageupdater.cpp | 101 ++- .../projectstorage/projectstorageupdater.h | 10 +- .../projectstorage/qmltypesparser.cpp | 16 +- .../projectstorage/qmltypesparser.h | 2 +- .../projectstorage/qmltypesparserinterface.h | 2 +- .../qmldesigner/qmldesignerprojectmanager.cpp | 38 +- .../qmldesigner/qmldesignerprojectmanager.h | 4 +- tests/unit/tests/mocks/projectstoragemock.h | 8 +- tests/unit/tests/mocks/qmltypesparsermock.h | 2 +- .../tests/printers/gtest-creator-printing.cpp | 6 +- .../tests/printers/gtest-creator-printing.h | 4 +- .../projectstorage/projectstorage-test.cpp | 148 ++-- .../projectstorageupdater-test.cpp | 813 +++++++++--------- .../projectstorage/qmltypesparser-test.cpp | 58 +- 20 files changed, 716 insertions(+), 712 deletions(-) diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.cpp b/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.cpp index ea35fec3722..98ee3253df7 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.cpp +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.cpp @@ -502,25 +502,25 @@ struct ProjectStorage::Statements "DELETE FROM exportedTypeNames WHERE exportedTypeNameId=?", database}; Sqlite::WriteStatement<2> updateExportedTypeNameTypeIdStatement{ "UPDATE exportedTypeNames SET typeId=?2 WHERE exportedTypeNameId=?1", database}; - mutable Sqlite::ReadStatement<4, 1> selectProjectDatasForSourceIdsStatement{ - "SELECT projectSourceId, sourceId, moduleId, fileType FROM projectDatas WHERE " - "projectSourceId IN carray(?1) ORDER BY projectSourceId, sourceId", + mutable Sqlite::ReadStatement<4, 1> selectDirectoryInfosForSourceIdsStatement{ + "SELECT directorySourceId, sourceId, moduleId, fileType FROM directoryInfos WHERE " + "directorySourceId IN carray(?1) ORDER BY directorySourceId, sourceId", database}; - Sqlite::WriteStatement<4> insertProjectDataStatement{ - "INSERT INTO projectDatas(projectSourceId, sourceId, " + Sqlite::WriteStatement<4> insertDirectoryInfoStatement{ + "INSERT INTO directoryInfos(directorySourceId, sourceId, " "moduleId, fileType) VALUES(?1, ?2, ?3, ?4)", database}; - Sqlite::WriteStatement<2> deleteProjectDataStatement{ - "DELETE FROM projectDatas WHERE projectSourceId=?1 AND sourceId=?2", database}; - Sqlite::WriteStatement<4> updateProjectDataStatement{ - "UPDATE projectDatas SET moduleId=?3, fileType=?4 WHERE projectSourceId=?1 AND sourceId=?2", + Sqlite::WriteStatement<2> deleteDirectoryInfoStatement{ + "DELETE FROM directoryInfos WHERE directorySourceId=?1 AND sourceId=?2", database}; + Sqlite::WriteStatement<4> updateDirectoryInfoStatement{ + "UPDATE directoryInfos SET moduleId=?3, fileType=?4 WHERE directorySourceId=?1 AND sourceId=?2", database}; - mutable Sqlite::ReadStatement<4, 1> selectProjectDatasForSourceIdStatement{ - "SELECT projectSourceId, sourceId, moduleId, fileType FROM projectDatas WHERE " - "projectSourceId=?1", + mutable Sqlite::ReadStatement<4, 1> selectDirectoryInfosForSourceIdStatement{ + "SELECT directorySourceId, sourceId, moduleId, fileType FROM directoryInfos WHERE " + "directorySourceId=?1", database}; - mutable Sqlite::ReadStatement<4, 1> selectProjectDataForSourceIdStatement{ - "SELECT projectSourceId, sourceId, moduleId, fileType FROM projectDatas WHERE " + mutable Sqlite::ReadStatement<4, 1> selectDirectoryInfoForSourceIdStatement{ + "SELECT directorySourceId, sourceId, moduleId, fileType FROM directoryInfos WHERE " "sourceId=?1 LIMIT 1", database}; mutable Sqlite::ReadStatement<1, 1> selectTypeIdsForSourceIdsStatement{ @@ -745,7 +745,7 @@ public: createModuleExportedImportsTable(database, moduleIdColumn); createDocumentImportsTable(database, moduleIdColumn); createFileStatusesTable(database); - createProjectDatasTable(database); + createDirectoryInfosTable(database); createPropertyEditorPathsTable(database); createTypeAnnotionsTable(database); } @@ -1063,19 +1063,19 @@ public: table.initialize(database); } - void createProjectDatasTable(Database &database) + void createDirectoryInfosTable(Database &database) { Sqlite::StrictTable table; table.setUseIfNotExists(true); table.setUseWithoutRowId(true); - table.setName("projectDatas"); - auto &projectSourceIdColumn = table.addColumn("projectSourceId", + table.setName("directoryInfos"); + auto &directorySourceIdColumn = table.addColumn("directorySourceId", Sqlite::StrictColumnType::Integer); auto &sourceIdColumn = table.addColumn("sourceId", Sqlite::StrictColumnType::Integer); table.addColumn("moduleId", Sqlite::StrictColumnType::Integer); table.addColumn("fileType", Sqlite::StrictColumnType::Integer); - table.addPrimaryKeyContraint({projectSourceIdColumn, sourceIdColumn}); + table.addPrimaryKeyContraint({directorySourceIdColumn, sourceIdColumn}); table.addUniqueIndex({sourceIdColumn}); table.initialize(database); @@ -1196,7 +1196,7 @@ void ProjectStorage::synchronize(Storage::Synchronization::SynchronizationPackag linkAliases(insertedAliasPropertyDeclarations, updatedAliasPropertyDeclarations); - synchronizeProjectDatas(package.projectDatas, package.updatedProjectSourceIds); + synchronizeDirectoryInfos(package.directoryInfos, package.updatedProjectSourceIds); commonTypeCache_.resetTypeIds(); }); @@ -2113,53 +2113,53 @@ FileStatus ProjectStorage::fetchFileStatus(SourceId sourceId) const return fileStatus; } -std::optional ProjectStorage::fetchProjectData(SourceId sourceId) const +std::optional ProjectStorage::fetchDirectoryInfo(SourceId sourceId) const { using NanotraceHR::keyValue; NanotraceHR::Tracer tracer{"fetch project data"_t, projectStorageCategory(), keyValue("source id", sourceId)}; - auto projectData = s->selectProjectDataForSourceIdStatement - .optionalValueWithTransaction( + auto directoryInfo = s->selectDirectoryInfoForSourceIdStatement + .optionalValueWithTransaction( sourceId); - tracer.end(keyValue("project data", projectData)); + tracer.end(keyValue("project data", directoryInfo)); - return projectData; + return directoryInfo; } -Storage::Synchronization::ProjectDatas ProjectStorage::fetchProjectDatas(SourceId projectSourceId) const +Storage::Synchronization::DirectoryInfos ProjectStorage::fetchDirectoryInfos(SourceId directorySourceId) const { using NanotraceHR::keyValue; NanotraceHR::Tracer tracer{"fetch project datas by source id"_t, projectStorageCategory(), - keyValue("source id", projectSourceId)}; + keyValue("source id", directorySourceId)}; - auto projectDatas = s->selectProjectDatasForSourceIdStatement - .valuesWithTransaction( - projectSourceId); + auto directoryInfos = s->selectDirectoryInfosForSourceIdStatement + .valuesWithTransaction( + directorySourceId); - tracer.end(keyValue("project datas", projectDatas)); + tracer.end(keyValue("project datas", directoryInfos)); - return projectDatas; + return directoryInfos; } -Storage::Synchronization::ProjectDatas ProjectStorage::fetchProjectDatas( - const SourceIds &projectSourceIds) const +Storage::Synchronization::DirectoryInfos ProjectStorage::fetchDirectoryInfos( + const SourceIds &directorySourceIds) const { using NanotraceHR::keyValue; NanotraceHR::Tracer tracer{"fetch project datas by source ids"_t, projectStorageCategory(), - keyValue("source ids", projectSourceIds)}; + keyValue("source ids", directorySourceIds)}; - auto projectDatas = s->selectProjectDatasForSourceIdsStatement - .valuesWithTransaction( - toIntegers(projectSourceIds)); + auto directoryInfos = s->selectDirectoryInfosForSourceIdsStatement + .valuesWithTransaction( + toIntegers(directorySourceIds)); - tracer.end(keyValue("project datas", projectDatas)); + tracer.end(keyValue("project datas", directoryInfos)); - return projectDatas; + return directoryInfos; } void ProjectStorage::setPropertyEditorPathId(TypeId typeId, SourceId pathId) @@ -2465,74 +2465,74 @@ void ProjectStorage::synchronizeTypes(Storage::Synchronization::Types &types, syncDefaultProperties(types); } -void ProjectStorage::synchronizeProjectDatas(Storage::Synchronization::ProjectDatas &projectDatas, +void ProjectStorage::synchronizeDirectoryInfos(Storage::Synchronization::DirectoryInfos &directoryInfos, const SourceIds &updatedProjectSourceIds) { NanotraceHR::Tracer tracer{"synchronize project datas"_t, projectStorageCategory()}; auto compareKey = [](auto &&first, auto &&second) { - auto projectSourceIdDifference = first.projectSourceId - second.projectSourceId; - if (projectSourceIdDifference != 0) - return projectSourceIdDifference; + auto directorySourceIdDifference = first.directorySourceId - second.directorySourceId; + if (directorySourceIdDifference != 0) + return directorySourceIdDifference; return first.sourceId - second.sourceId; }; - std::sort(projectDatas.begin(), projectDatas.end(), [&](auto &&first, auto &&second) { - return std::tie(first.projectSourceId, first.sourceId) - < std::tie(second.projectSourceId, second.sourceId); + std::sort(directoryInfos.begin(), directoryInfos.end(), [&](auto &&first, auto &&second) { + return std::tie(first.directorySourceId, first.sourceId) + < std::tie(second.directorySourceId, second.sourceId); }); - auto range = s->selectProjectDatasForSourceIdsStatement.range( + auto range = s->selectDirectoryInfosForSourceIdsStatement.range( toIntegers(updatedProjectSourceIds)); - auto insert = [&](const Storage::Synchronization::ProjectData &projectData) { + auto insert = [&](const Storage::Synchronization::DirectoryInfo &directoryInfo) { using NanotraceHR::keyValue; NanotraceHR::Tracer tracer{"insert project data"_t, projectStorageCategory(), - keyValue("project data", projectData)}; + keyValue("project data", directoryInfo)}; - if (!projectData.projectSourceId) - throw ProjectDataHasInvalidProjectSourceId{}; - if (!projectData.sourceId) - throw ProjectDataHasInvalidSourceId{}; + if (!directoryInfo.directorySourceId) + throw DirectoryInfoHasInvalidProjectSourceId{}; + if (!directoryInfo.sourceId) + throw DirectoryInfoHasInvalidSourceId{}; - s->insertProjectDataStatement.write(projectData.projectSourceId, - projectData.sourceId, - projectData.moduleId, - projectData.fileType); + s->insertDirectoryInfoStatement.write(directoryInfo.directorySourceId, + directoryInfo.sourceId, + directoryInfo.moduleId, + directoryInfo.fileType); }; - auto update = [&](const Storage::Synchronization::ProjectData &projectDataFromDatabase, - const Storage::Synchronization::ProjectData &projectData) { - if (projectDataFromDatabase.fileType != projectData.fileType - || !compareInvalidAreTrue(projectDataFromDatabase.moduleId, projectData.moduleId)) { + auto update = [&](const Storage::Synchronization::DirectoryInfo &directoryInfoFromDatabase, + const Storage::Synchronization::DirectoryInfo &directoryInfo) { + if (directoryInfoFromDatabase.fileType != directoryInfo.fileType + || !compareInvalidAreTrue(directoryInfoFromDatabase.moduleId, directoryInfo.moduleId)) { using NanotraceHR::keyValue; NanotraceHR::Tracer tracer{"update project data"_t, projectStorageCategory(), - keyValue("project data", projectData), - keyValue("project data from database", projectDataFromDatabase)}; + keyValue("project data", directoryInfo), + keyValue("project data from database", directoryInfoFromDatabase)}; - s->updateProjectDataStatement.write(projectData.projectSourceId, - projectData.sourceId, - projectData.moduleId, - projectData.fileType); + s->updateDirectoryInfoStatement.write(directoryInfo.directorySourceId, + directoryInfo.sourceId, + directoryInfo.moduleId, + directoryInfo.fileType); return Sqlite::UpdateChange::Update; } return Sqlite::UpdateChange::No; }; - auto remove = [&](const Storage::Synchronization::ProjectData &projectData) { + auto remove = [&](const Storage::Synchronization::DirectoryInfo &directoryInfo) { using NanotraceHR::keyValue; NanotraceHR::Tracer tracer{"remove project data"_t, projectStorageCategory(), - keyValue("project data", projectData)}; + keyValue("project data", directoryInfo)}; - s->deleteProjectDataStatement.write(projectData.projectSourceId, projectData.sourceId); + s->deleteDirectoryInfoStatement.write(directoryInfo.directorySourceId, directoryInfo.sourceId); }; - Sqlite::insertUpdateDelete(range, projectDatas, compareKey, insert, update, remove); + Sqlite::insertUpdateDelete(range, directoryInfos, compareKey, insert, update, remove); } void ProjectStorage::synchronizeFileStatuses(FileStatuses &fileStatuses, diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.h index 85eebeb2cb5..0ae508f58f1 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.h @@ -229,11 +229,11 @@ public: FileStatus fetchFileStatus(SourceId sourceId) const override; - std::optional fetchProjectData(SourceId sourceId) const override; + std::optional fetchDirectoryInfo(SourceId sourceId) const override; - Storage::Synchronization::ProjectDatas fetchProjectDatas(SourceId projectSourceId) const override; + Storage::Synchronization::DirectoryInfos fetchDirectoryInfos(SourceId directorySourceId) const override; - Storage::Synchronization::ProjectDatas fetchProjectDatas(const SourceIds &projectSourceIds) const; + Storage::Synchronization::DirectoryInfos fetchDirectoryInfos(const SourceIds &directorySourceIds) const; void setPropertyEditorPathId(TypeId typeId, SourceId pathId); @@ -560,7 +560,7 @@ private: Prototypes &relinkableExtensions, const SourceIds &updatedSourceIds); - void synchronizeProjectDatas(Storage::Synchronization::ProjectDatas &projectDatas, + void synchronizeDirectoryInfos(Storage::Synchronization::DirectoryInfos &directoryInfos, const SourceIds &updatedProjectSourceIds); void synchronizeFileStatuses(FileStatuses &fileStatuses, const SourceIds &updatedSourceIds); diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageexceptions.cpp b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageexceptions.cpp index a5dc60c4fa4..a86b78a785f 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageexceptions.cpp +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageexceptions.cpp @@ -148,32 +148,32 @@ const char *CannotParseQmlDocumentFile::what() const noexcept return "Cannot parse qml types file!"; } -ProjectDataHasInvalidProjectSourceId::ProjectDataHasInvalidProjectSourceId() +DirectoryInfoHasInvalidProjectSourceId::DirectoryInfoHasInvalidProjectSourceId() { - category().threadEvent("ProjectDataHasInvalidProjectSourceId"_t); + category().threadEvent("DirectoryInfoHasInvalidProjectSourceId"_t); } -const char *ProjectDataHasInvalidProjectSourceId::what() const noexcept +const char *DirectoryInfoHasInvalidProjectSourceId::what() const noexcept { return "The project source id is invalid!"; } -ProjectDataHasInvalidSourceId::ProjectDataHasInvalidSourceId() +DirectoryInfoHasInvalidSourceId::DirectoryInfoHasInvalidSourceId() { - category().threadEvent("ProjectDataHasInvalidSourceId"_t); + category().threadEvent("DirectoryInfoHasInvalidSourceId"_t); } -const char *ProjectDataHasInvalidSourceId::what() const noexcept +const char *DirectoryInfoHasInvalidSourceId::what() const noexcept { return "The source id is invalid!"; } -ProjectDataHasInvalidModuleId::ProjectDataHasInvalidModuleId() +DirectoryInfoHasInvalidModuleId::DirectoryInfoHasInvalidModuleId() { - category().threadEvent("ProjectDataHasInvalidModuleId"_t); + category().threadEvent("DirectoryInfoHasInvalidModuleId"_t); } -const char *ProjectDataHasInvalidModuleId::what() const noexcept +const char *DirectoryInfoHasInvalidModuleId::what() const noexcept { return "The module id is invalid!"; } diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageexceptions.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageexceptions.h index d85f1f7f9ee..f4f78f714bb 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageexceptions.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageexceptions.h @@ -130,24 +130,24 @@ public: const char *what() const noexcept override; }; -class QMLDESIGNERCORE_EXPORT ProjectDataHasInvalidProjectSourceId : public ProjectStorageError +class QMLDESIGNERCORE_EXPORT DirectoryInfoHasInvalidProjectSourceId : public ProjectStorageError { public: - ProjectDataHasInvalidProjectSourceId(); + DirectoryInfoHasInvalidProjectSourceId(); const char *what() const noexcept override; }; -class QMLDESIGNERCORE_EXPORT ProjectDataHasInvalidSourceId : public ProjectStorageError +class QMLDESIGNERCORE_EXPORT DirectoryInfoHasInvalidSourceId : public ProjectStorageError { public: - ProjectDataHasInvalidSourceId(); + DirectoryInfoHasInvalidSourceId(); const char *what() const noexcept override; }; -class QMLDESIGNERCORE_EXPORT ProjectDataHasInvalidModuleId : public ProjectStorageError +class QMLDESIGNERCORE_EXPORT DirectoryInfoHasInvalidModuleId : public ProjectStorageError { public: - ProjectDataHasInvalidModuleId(); + DirectoryInfoHasInvalidModuleId(); const char *what() const noexcept override; }; diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageinterface.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageinterface.h index 2a1415e7918..fcaccd932ff 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageinterface.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageinterface.h @@ -80,8 +80,8 @@ public: virtual bool isBasedOn(TypeId, TypeId, TypeId, TypeId, TypeId, TypeId, TypeId, TypeId) const = 0; virtual FileStatus fetchFileStatus(SourceId sourceId) const = 0; - virtual Storage::Synchronization::ProjectDatas fetchProjectDatas(SourceId sourceId) const = 0; - virtual std::optional fetchProjectData(SourceId sourceId) const = 0; + virtual Storage::Synchronization::DirectoryInfos fetchDirectoryInfos(SourceId sourceId) const = 0; + virtual std::optional fetchDirectoryInfo(SourceId sourceId) const = 0; virtual SourceId propertyEditorPathId(TypeId typeId) const = 0; virtual const Storage::Info::CommonTypeCache &commonTypeCache() const = 0; diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h index 8d810d94bd2..7eb3767219b 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h @@ -1160,44 +1160,44 @@ public: using PropertyEditorQmlPaths = std::vector; -class ProjectData +class DirectoryInfo { public: - ProjectData(SourceId projectSourceId, SourceId sourceId, ModuleId moduleId, FileType fileType) - : projectSourceId{projectSourceId} + DirectoryInfo(SourceId directorySourceId, SourceId sourceId, ModuleId moduleId, FileType fileType) + : directorySourceId{directorySourceId} , sourceId{sourceId} , moduleId{moduleId} , fileType{fileType} {} - friend bool operator==(const ProjectData &first, const ProjectData &second) + friend bool operator==(const DirectoryInfo &first, const DirectoryInfo &second) { - return first.projectSourceId == second.projectSourceId && first.sourceId == second.sourceId + return first.directorySourceId == second.directorySourceId && first.sourceId == second.sourceId && first.moduleId.internalId() == second.moduleId.internalId() && first.fileType == second.fileType; } template - friend void convertToString(String &string, const ProjectData &projectData) + friend void convertToString(String &string, const DirectoryInfo &directoryInfo) { using NanotraceHR::dictonary; using NanotraceHR::keyValue; - auto dict = dictonary(keyValue("project source id", projectData.projectSourceId), - keyValue("source id", projectData.sourceId), - keyValue("module id", projectData.moduleId), - keyValue("file type", projectData.fileType)); + auto dict = dictonary(keyValue("project source id", directoryInfo.directorySourceId), + keyValue("source id", directoryInfo.sourceId), + keyValue("module id", directoryInfo.moduleId), + keyValue("file type", directoryInfo.fileType)); convertToString(string, dict); } public: - SourceId projectSourceId; + SourceId directorySourceId; SourceId sourceId; ModuleId moduleId; FileType fileType; }; -using ProjectDatas = std::vector; +using DirectoryInfos = std::vector; class TypeAnnotation { @@ -1291,8 +1291,8 @@ public: , fileStatuses(std::move(fileStatuses)) {} - SynchronizationPackage(SourceIds updatedProjectSourceIds, ProjectDatas projectDatas) - : projectDatas(std::move(projectDatas)) + SynchronizationPackage(SourceIds updatedProjectSourceIds, DirectoryInfos directoryInfos) + : directoryInfos(std::move(directoryInfos)) , updatedProjectSourceIds(std::move(updatedProjectSourceIds)) {} @@ -1302,7 +1302,7 @@ public: SourceIds updatedSourceIds; SourceIds updatedFileStatusSourceIds; FileStatuses fileStatuses; - ProjectDatas projectDatas; + DirectoryInfos directoryInfos; SourceIds updatedProjectSourceIds; Imports moduleDependencies; SourceIds updatedModuleDependencySourceIds; diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.cpp b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.cpp index 509ffde99a9..e6f347ff12a 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.cpp +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.cpp @@ -134,13 +134,13 @@ SourceIds filterNotUpdatedSourceIds(SourceIds updatedSourceIds, SourceIds notUpd } void addSourceIds(SourceIds &sourceIds, - const Storage::Synchronization::ProjectDatas &projectDatas, + const Storage::Synchronization::DirectoryInfos &directoryInfos, TracerLiteral message, Tracer &tracer) { - for (const auto &projectData : projectDatas) { - tracer.tick(message, keyValue("source id", projectData.sourceId)); - sourceIds.push_back(projectData.sourceId); + for (const auto &directoryInfo : directoryInfos) { + tracer.tick(message, keyValue("source id", directoryInfo.sourceId)); + sourceIds.push_back(directoryInfo.sourceId); } } @@ -311,19 +311,17 @@ void ProjectStorageUpdater::updateQmlTypes(const QStringList &qmlTypesPaths, keyValue("source id", sourceId), keyValue("qml types path", qmlTypesPath)); - Storage::Synchronization::ProjectData projectData{sourceId, - sourceId, - moduleId, - Storage::Synchronization::FileType::QmlTypes}; + Storage::Synchronization::DirectoryInfo directoryInfo{ + sourceId, sourceId, moduleId, Storage::Synchronization::FileType::QmlTypes}; - FileState state = parseTypeInfo(projectData, + FileState state = parseTypeInfo(directoryInfo, Utils::PathString{qmlTypesPath}, package, notUpdatedSourceIds); if (state == FileState::Changed) { - tracer.tick("append project data"_t, keyValue("project data", projectData)); - package.projectDatas.push_back(std::move(projectData)); + tracer.tick("append project data"_t, keyValue("project data", directoryInfo)); + package.directoryInfos.push_back(std::move(directoryInfo)); tracer.tick("append updated project source ids"_t, keyValue("source id", sourceId)); package.updatedProjectSourceIds.push_back(sourceId); } @@ -382,10 +380,10 @@ void ProjectStorageUpdater::updateDirectoryChanged(std::string_view directoryPat tracer.tick("append updated module id"_t, keyValue("module id", moduleId)); package.updatedModuleIds.push_back(moduleId); - const auto qmlProjectDatas = m_projectStorage.fetchProjectDatas(directorySourceId); - addSourceIds(package.updatedSourceIds, qmlProjectDatas, "append updated source id"_t, tracer); + const auto qmlDirectoryInfos = m_projectStorage.fetchDirectoryInfos(directorySourceId); + addSourceIds(package.updatedSourceIds, qmlDirectoryInfos, "append updated source id"_t, tracer); addSourceIds(package.updatedFileStatusSourceIds, - qmlProjectDatas, + qmlDirectoryInfos, "append updated file status source id"_t, tracer); @@ -463,10 +461,10 @@ void ProjectStorageUpdater::updateDirectory(const Utils::PathString &directoryPa case FileState::NotChanged: { tracer.tick("update directory not changed"_t); - parseProjectDatas(m_projectStorage.fetchProjectDatas(directorySourceId), - package, - notUpdatedSourceIds, - watchedSourceIdsIds); + parseDirectoryInfos(m_projectStorage.fetchDirectoryInfos(directorySourceId), + package, + notUpdatedSourceIds, + watchedSourceIdsIds); break; } case FileState::NotExists: { @@ -476,13 +474,13 @@ void ProjectStorageUpdater::updateDirectory(const Utils::PathString &directoryPa package.updatedFileStatusSourceIds.push_back(qmldirSourceId); package.updatedProjectSourceIds.push_back(directorySourceId); package.updatedSourceIds.push_back(qmldirSourceId); - auto qmlProjectDatas = m_projectStorage.fetchProjectDatas(directorySourceId); - for (const Storage::Synchronization::ProjectData &projectData : qmlProjectDatas) { - tracer.tick("append updated source id"_t, keyValue("source id", projectData.sourceId)); - package.updatedSourceIds.push_back(projectData.sourceId); + auto qmlDirectoryInfos = m_projectStorage.fetchDirectoryInfos(directorySourceId); + for (const Storage::Synchronization::DirectoryInfo &directoryInfo : qmlDirectoryInfos) { + tracer.tick("append updated source id"_t, keyValue("source id", directoryInfo.sourceId)); + package.updatedSourceIds.push_back(directoryInfo.sourceId); tracer.tick("append updated file status source id"_t, - keyValue("source id", projectData.sourceId)); - package.updatedFileStatusSourceIds.push_back(projectData.sourceId); + keyValue("source id", directoryInfo.sourceId)); + package.updatedFileStatusSourceIds.push_back(directoryInfo.sourceId); } break; @@ -802,9 +800,9 @@ void ProjectStorageUpdater::pathsWithIdsChanged(const std::vector &chan for (SourceId sourceId : filterUniqueSourceIds(std::move(qmltypesSourceIds))) { if (!contains(directorySourceContextIds, m_pathCache.sourceContextId(sourceId))) { auto qmltypesPath = m_pathCache.sourcePath(sourceId); - auto projectData = m_projectStorage.fetchProjectData(sourceId); - if (projectData) - parseTypeInfo(*projectData, qmltypesPath, package, notUpdatedSourceIds); + auto directoryInfo = m_projectStorage.fetchDirectoryInfo(sourceId); + if (directoryInfo) + parseTypeInfo(*directoryInfo, qmltypesPath, package, notUpdatedSourceIds); } } } catch (const QmlDesigner::CannotParseQmlTypesFile &) { @@ -869,41 +867,42 @@ void ProjectStorageUpdater::parseTypeInfos(const QStringList &typeInfos, tracer.tick("append module dependenct source source id"_t, keyValue("source id", sourceId)); package.updatedModuleDependencySourceIds.push_back(sourceId); - auto projectData = package.projectDatas.emplace_back( + auto directoryInfo = package.directoryInfos.emplace_back( directorySourceId, sourceId, moduleId, Storage::Synchronization::FileType::QmlTypes); tracer.tick("append project data"_t, keyValue("source id", sourceId)); - parseTypeInfo(projectData, qmltypesPath, package, notUpdatedSourceIds); + parseTypeInfo(directoryInfo, qmltypesPath, package, notUpdatedSourceIds); } } -void ProjectStorageUpdater::parseProjectDatas(const Storage::Synchronization::ProjectDatas &projectDatas, - Storage::Synchronization::SynchronizationPackage &package, - NotUpdatedSourceIds ¬UpdatedSourceIds, - WatchedSourceIdsIds &watchedSourceIds) +void ProjectStorageUpdater::parseDirectoryInfos( + const Storage::Synchronization::DirectoryInfos &directoryInfos, + Storage::Synchronization::SynchronizationPackage &package, + NotUpdatedSourceIds ¬UpdatedSourceIds, + WatchedSourceIdsIds &watchedSourceIds) { NanotraceHR::Tracer tracer{"parse project datas"_t, category()}; - for (const Storage::Synchronization::ProjectData &projectData : projectDatas) { - switch (projectData.fileType) { + for (const Storage::Synchronization::DirectoryInfo &directoryInfo : directoryInfos) { + switch (directoryInfo.fileType) { case Storage::Synchronization::FileType::QmlTypes: { - watchedSourceIds.qmltypesSourceIds.push_back(projectData.sourceId); + watchedSourceIds.qmltypesSourceIds.push_back(directoryInfo.sourceId); - auto qmltypesPath = m_pathCache.sourcePath(projectData.sourceId); - parseTypeInfo(projectData, qmltypesPath, package, notUpdatedSourceIds); + auto qmltypesPath = m_pathCache.sourcePath(directoryInfo.sourceId); + parseTypeInfo(directoryInfo, qmltypesPath, package, notUpdatedSourceIds); break; } case Storage::Synchronization::FileType::QmlDocument: { - watchedSourceIds.qmlSourceIds.push_back(projectData.sourceId); + watchedSourceIds.qmlSourceIds.push_back(directoryInfo.sourceId); - parseQmlComponent(projectData.sourceId, package, notUpdatedSourceIds); + parseQmlComponent(directoryInfo.sourceId, package, notUpdatedSourceIds); break; } } } } -auto ProjectStorageUpdater::parseTypeInfo(const Storage::Synchronization::ProjectData &projectData, +auto ProjectStorageUpdater::parseTypeInfo(const Storage::Synchronization::DirectoryInfo &directoryInfo, Utils::SmallStringView qmltypesPath, Storage::Synchronization::SynchronizationPackage &package, NotUpdatedSourceIds ¬UpdatedSourceIds) -> FileState @@ -912,19 +911,19 @@ auto ProjectStorageUpdater::parseTypeInfo(const Storage::Synchronization::Projec category(), keyValue("qmltypes path", qmltypesPath)}; - auto state = fileState(projectData.sourceId, package, notUpdatedSourceIds); + auto state = fileState(directoryInfo.sourceId, package, notUpdatedSourceIds); switch (state) { case FileState::Changed: { - tracer.tick("append updated source ids"_t, keyValue("source id", projectData.sourceId)); - package.updatedSourceIds.push_back(projectData.sourceId); + tracer.tick("append updated source ids"_t, keyValue("source id", directoryInfo.sourceId)); + package.updatedSourceIds.push_back(directoryInfo.sourceId); const auto content = m_fileSystem.contentAsQString(QString{qmltypesPath}); - m_qmlTypesParser.parse(content, package.imports, package.types, projectData); + m_qmlTypesParser.parse(content, package.imports, package.types, directoryInfo); break; } case FileState::NotChanged: { - tracer.tick("append not updated source ids"_t, keyValue("source id", projectData.sourceId)); - notUpdatedSourceIds.sourceIds.push_back(projectData.sourceId); + tracer.tick("append not updated source ids"_t, keyValue("source id", directoryInfo.sourceId)); + notUpdatedSourceIds.sourceIds.push_back(directoryInfo.sourceId); break; } case FileState::NotExists: @@ -971,9 +970,9 @@ void ProjectStorageUpdater::parseQmlComponent(Utils::SmallStringView relativeFil tracer.tick("append not updated source id"_t, keyValue("source id", sourceId)); notUpdatedSourceIds.sourceIds.emplace_back(sourceId); - const auto &projectData = package.projectDatas.emplace_back( + const auto &directoryInfo = package.directoryInfos.emplace_back( directorySourceId, sourceId, ModuleId{}, Storage::Synchronization::FileType::QmlDocument); - tracer.tick("append project data"_t, keyValue("project data", projectData)); + tracer.tick("append project data"_t, keyValue("project data", directoryInfo)); return; } @@ -987,9 +986,9 @@ void ProjectStorageUpdater::parseQmlComponent(Utils::SmallStringView relativeFil break; } - const auto &projectData = package.projectDatas.emplace_back( + const auto &directoryInfo = package.directoryInfos.emplace_back( directorySourceId, sourceId, ModuleId{}, Storage::Synchronization::FileType::QmlDocument); - tracer.tick("append project data"_t, keyValue("project data", projectData)); + tracer.tick("append project data"_t, keyValue("project data", directoryInfo)); tracer.tick("append updated source id"_t, keyValue("source id", sourceId)); package.updatedSourceIds.push_back(sourceId); diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.h index bbaa71a2891..3cb7d24c3f6 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.h @@ -192,11 +192,11 @@ private: Storage::Synchronization::SynchronizationPackage &package, NotUpdatedSourceIds ¬UpdatedSourceIds, WatchedSourceIdsIds &watchedSourceIdsIds); - void parseProjectDatas(const Storage::Synchronization::ProjectDatas &projectDatas, - Storage::Synchronization::SynchronizationPackage &package, - NotUpdatedSourceIds ¬UpdatedSourceIds, - WatchedSourceIdsIds &watchedSourceIdsIds); - FileState parseTypeInfo(const Storage::Synchronization::ProjectData &projectData, + void parseDirectoryInfos(const Storage::Synchronization::DirectoryInfos &directoryInfos, + Storage::Synchronization::SynchronizationPackage &package, + NotUpdatedSourceIds ¬UpdatedSourceIds, + WatchedSourceIdsIds &watchedSourceIdsIds); + FileState parseTypeInfo(const Storage::Synchronization::DirectoryInfo &directoryInfo, Utils::SmallStringView qmltypesPath, Storage::Synchronization::SynchronizationPackage &package, NotUpdatedSourceIds ¬UpdatedSourceIds); diff --git a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.cpp b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.cpp index 66b40d76ca8..b3ec4f00242 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.cpp +++ b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.cpp @@ -495,7 +495,7 @@ bool skipType(const QQmlJSExportedScope &object, Utils::span &objects, QmlTypesParser::ProjectStorage &storage, const ComponentWithoutNamespaces &componentNameWithoutNamespaces) @@ -503,15 +503,15 @@ void addTypes(Storage::Synchronization::Types &types, NanotraceHR::Tracer tracer{"add types"_t, category()}; types.reserve(Utils::usize(objects) + types.size()); - const auto skipList = getSkipList(storage.module(projectData.moduleId)); + const auto skipList = getSkipList(storage.module(directoryInfo.moduleId)); for (const auto &object : objects) { if (skipType(object, skipList)) continue; addType(types, - projectData.sourceId, - projectData.moduleId, + directoryInfo.sourceId, + directoryInfo.moduleId, object, storage, componentNameWithoutNamespaces); @@ -523,7 +523,7 @@ void addTypes(Storage::Synchronization::Types &types, void QmlTypesParser::parse(const QString &sourceContent, Storage::Imports &imports, Storage::Synchronization::Types &types, - const Storage::Synchronization::ProjectData &projectData) + const Storage::Synchronization::DirectoryInfo &directoryInfo) { NanotraceHR::Tracer tracer{"qmltypes parser parse"_t, category()}; @@ -536,8 +536,8 @@ void QmlTypesParser::parse(const QString &sourceContent, auto componentNameWithoutNamespaces = createComponentNameWithoutNamespaces(components); - addImports(imports, projectData.sourceId, dependencies, m_storage, projectData.moduleId); - addTypes(types, projectData, components, m_storage, componentNameWithoutNamespaces); + addImports(imports, directoryInfo.sourceId, dependencies, m_storage, directoryInfo.moduleId); + addTypes(types, directoryInfo, components, m_storage, componentNameWithoutNamespaces); } #else @@ -545,7 +545,7 @@ void QmlTypesParser::parse(const QString &sourceContent, void QmlTypesParser::parse([[maybe_unused]] const QString &sourceContent, [[maybe_unused]] Storage::Imports &imports, [[maybe_unused]] Storage::Synchronization::Types &types, - [[maybe_unused]] const Storage::Synchronization::ProjectData &projectData) + [[maybe_unused]] const Storage::Synchronization::DirectoryInfo &directoryInfo) {} #endif diff --git a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h index 4a6427501b3..c73a429f912 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h @@ -31,7 +31,7 @@ public: void parse(const QString &sourceContent, Storage::Imports &imports, Storage::Synchronization::Types &types, - const Storage::Synchronization::ProjectData &projectData) override; + const Storage::Synchronization::DirectoryInfo &directoryInfo) override; private: #ifdef QDS_BUILD_QMLPARSER diff --git a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparserinterface.h b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparserinterface.h index cdc7cd54d7e..c0880cf5c64 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparserinterface.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparserinterface.h @@ -15,7 +15,7 @@ public: virtual void parse(const QString &sourceContent, Storage::Imports &imports, Storage::Synchronization::Types &types, - const Storage::Synchronization::ProjectData &projectData) + const Storage::Synchronization::DirectoryInfo &directoryInfo) = 0; protected: diff --git a/src/plugins/qmldesigner/qmldesignerprojectmanager.cpp b/src/plugins/qmldesigner/qmldesignerprojectmanager.cpp index 9602bf050fa..7954b6901bb 100644 --- a/src/plugins/qmldesigner/qmldesignerprojectmanager.cpp +++ b/src/plugins/qmldesigner/qmldesignerprojectmanager.cpp @@ -210,10 +210,10 @@ std::unique_ptr createProjectStorageData(::ProjectExplorer:: } } // namespace -class QmlDesignerProjectManager::QmlDesignerProjectManagerProjectData +class QmlDesignerProjectManager::QmlDesignerProjectManagerDirectoryInfo { public: - QmlDesignerProjectManagerProjectData(ImageCacheStorage &storage, + QmlDesignerProjectManagerDirectoryInfo(ImageCacheStorage &storage, ::ProjectExplorer::Project *project, ExternalDependenciesInterface &externalDependencies) : collector{connectionManager, @@ -297,8 +297,8 @@ namespace { ProjectStorageDependencies QmlDesignerProjectManager::projectStorageDependencies() { if constexpr (useProjectStorage()) { - return {m_projectData->projectStorageData->storage, - m_projectData->projectStorageData->pathCache}; + return {m_directoryInfo->projectStorageData->storage, + m_directoryInfo->projectStorageData->pathCache}; } else { return {*dummyProjectStorage(), *dummyPathCache()}; } @@ -499,10 +499,10 @@ QString qtCreatorItemLibraryPath() void QmlDesignerProjectManager::projectAdded(::ProjectExplorer::Project *project) { - m_projectData = std::make_unique(m_previewImageCacheData->storage, + m_directoryInfo = std::make_unique(m_previewImageCacheData->storage, project, m_externalDependencies); - m_projectData->activeTarget = project->activeTarget(); + m_directoryInfo->activeTarget = project->activeTarget(); QObject::connect(project, &::ProjectExplorer::Project::fileListChanged, [&]() { fileListChanged(); @@ -522,9 +522,9 @@ void QmlDesignerProjectManager::projectAdded(::ProjectExplorer::Project *project void QmlDesignerProjectManager::aboutToRemoveProject(::ProjectExplorer::Project *) { - if (m_projectData) { - m_previewImageCacheData->collector.setTarget(m_projectData->activeTarget); - m_projectData.reset(); + if (m_directoryInfo) { + m_previewImageCacheData->collector.setTarget(m_directoryInfo->activeTarget); + m_directoryInfo.reset(); } } @@ -532,14 +532,14 @@ void QmlDesignerProjectManager::projectRemoved(::ProjectExplorer::Project *) {} void QmlDesignerProjectManager::generatePreview() { - if (!m_projectData || !m_projectData->activeTarget) + if (!m_directoryInfo || !m_directoryInfo->activeTarget) return; ::QmlProjectManager::QmlBuildSystem *qmlBuildSystem = getQmlBuildSystem( - m_projectData->activeTarget); + m_directoryInfo->activeTarget); if (qmlBuildSystem) { - m_previewImageCacheData->collector.setTarget(m_projectData->activeTarget); + m_previewImageCacheData->collector.setTarget(m_directoryInfo->activeTarget); m_previewImageCacheData->factory.generate(qmlBuildSystem->mainFilePath().toString().toUtf8()); } } @@ -587,12 +587,12 @@ void QmlDesignerProjectManager::fileListChanged() void QmlDesignerProjectManager::activeTargetChanged(ProjectExplorer::Target *target) { - if (!m_projectData || !m_projectData->projectStorageData) + if (!m_directoryInfo || !m_directoryInfo->projectStorageData) return; - QObject::disconnect(m_projectData->activeTarget, nullptr, nullptr, nullptr); + QObject::disconnect(m_directoryInfo->activeTarget, nullptr, nullptr, nullptr); - m_projectData->activeTarget = target; + m_directoryInfo->activeTarget = target; if (target) { QObject::connect(target, &::ProjectExplorer::Target::kitChanged, [&]() { kitChanged(); }); @@ -625,17 +625,17 @@ void QmlDesignerProjectManager::projectChanged() void QmlDesignerProjectManager::update() { - if (!m_projectData || !m_projectData->projectStorageData) + if (!m_directoryInfo || !m_directoryInfo->projectStorageData) return; if constexpr (isUsingQmlDesignerLite()) { - m_projectData->projectStorageData->updater.update(directoriesForLiteDesigner(), + m_directoryInfo->projectStorageData->updater.update(directoriesForLiteDesigner(), qmlTypesForLiteDesigner(), propertyEditorResourcesPath(), {qtCreatorItemLibraryPath()}); } else { - m_projectData->projectStorageData->updater.update(directories(m_projectData->activeTarget), - qmlTypes(m_projectData->activeTarget), + m_directoryInfo->projectStorageData->updater.update(directories(m_directoryInfo->activeTarget), + qmlTypes(m_directoryInfo->activeTarget), propertyEditorResourcesPath(), {qtCreatorItemLibraryPath()}); } diff --git a/src/plugins/qmldesigner/qmldesignerprojectmanager.h b/src/plugins/qmldesigner/qmldesignerprojectmanager.h index bd45bf16c9a..3024d041b5f 100644 --- a/src/plugins/qmldesigner/qmldesignerprojectmanager.h +++ b/src/plugins/qmldesigner/qmldesignerprojectmanager.h @@ -32,7 +32,7 @@ class QmlDesignerProjectManager : public QObject { Q_OBJECT - class QmlDesignerProjectManagerProjectData; + class QmlDesignerProjectManagerDirectoryInfo; class PreviewImageCacheData; class ImageCacheData; @@ -68,7 +68,7 @@ private: std::once_flag imageCacheFlag; std::unique_ptr m_imageCacheData; std::unique_ptr m_previewImageCacheData; - std::unique_ptr m_projectData; + std::unique_ptr m_directoryInfo; ExternalDependenciesInterface &m_externalDependencies; }; } // namespace QmlDesigner diff --git a/tests/unit/tests/mocks/projectstoragemock.h b/tests/unit/tests/mocks/projectstoragemock.h index dad9f4db100..a0e880bc09e 100644 --- a/tests/unit/tests/mocks/projectstoragemock.h +++ b/tests/unit/tests/mocks/projectstoragemock.h @@ -300,13 +300,13 @@ public: (QmlDesigner::SourceId sourceId), (const, override)); - MOCK_METHOD(QmlDesigner::Storage::Synchronization::ProjectDatas, - fetchProjectDatas, + MOCK_METHOD(QmlDesigner::Storage::Synchronization::DirectoryInfos, + fetchDirectoryInfos, (QmlDesigner::SourceId sourceId), (const, override)); - MOCK_METHOD(std::optional, - fetchProjectData, + MOCK_METHOD(std::optional, + fetchDirectoryInfo, (QmlDesigner::SourceId sourceId), (const, override)); diff --git a/tests/unit/tests/mocks/qmltypesparsermock.h b/tests/unit/tests/mocks/qmltypesparsermock.h index e3fa1ca6053..0f57c634d07 100644 --- a/tests/unit/tests/mocks/qmltypesparsermock.h +++ b/tests/unit/tests/mocks/qmltypesparsermock.h @@ -15,6 +15,6 @@ public: (const QString &sourceContent, QmlDesigner::Storage::Imports &imports, QmlDesigner::Storage::Synchronization::Types &types, - const QmlDesigner::Storage::Synchronization::ProjectData &projectData), + const QmlDesigner::Storage::Synchronization::DirectoryInfo &directoryInfo), (override)); }; diff --git a/tests/unit/tests/printers/gtest-creator-printing.cpp b/tests/unit/tests/printers/gtest-creator-printing.cpp index 88b17e59309..165f54ebfbd 100644 --- a/tests/unit/tests/printers/gtest-creator-printing.cpp +++ b/tests/unit/tests/printers/gtest-creator-printing.cpp @@ -792,7 +792,7 @@ std::ostream &operator<<(std::ostream &out, const SynchronizationPackage &packag << ", fileStatuses: " << package.fileStatuses << ", updatedFileStatusSourceIds: " << package.updatedFileStatusSourceIds << ", updatedProjectSourceIds: " << package.updatedProjectSourceIds - << ", projectDatas: " << package.projectDatas + << ", directoryInfos: " << package.directoryInfos << ", propertyEditorQmlPaths: " << package.propertyEditorQmlPaths << ", updatedPropertyEditorQmlPathSourceIds: " << package.updatedPropertyEditorQmlPathSourceIds @@ -801,9 +801,9 @@ std::ostream &operator<<(std::ostream &out, const SynchronizationPackage &packag << ")"; } -std::ostream &operator<<(std::ostream &out, const ProjectData &data) +std::ostream &operator<<(std::ostream &out, const DirectoryInfo &data) { - return out << "(" << data.projectSourceId << ", " << data.sourceId << ", " << data.moduleId + return out << "(" << data.directorySourceId << ", " << data.sourceId << ", " << data.moduleId << ", " << data.fileType << ")"; } diff --git a/tests/unit/tests/printers/gtest-creator-printing.h b/tests/unit/tests/printers/gtest-creator-printing.h index 8d0c77888ec..2444b9d98b5 100644 --- a/tests/unit/tests/printers/gtest-creator-printing.h +++ b/tests/unit/tests/printers/gtest-creator-printing.h @@ -207,7 +207,7 @@ class EnumeratorDeclaration; enum class ImportKind : char; enum class IsAutoVersion : char; enum class IsQualified : int; -class ProjectData; +class DirectoryInfo; class SynchronizationPackage; enum class FileType : char; enum class ChangeLevel : char; @@ -227,7 +227,7 @@ std::ostream &operator<<(std::ostream &out, const EnumerationDeclaration &enumer std::ostream &operator<<(std::ostream &out, const EnumeratorDeclaration &enumeratorDeclaration); std::ostream &operator<<(std::ostream &out, const ImportKind &importKind); std::ostream &operator<<(std::ostream &out, IsQualified isQualified); -std::ostream &operator<<(std::ostream &out, const ProjectData &data); +std::ostream &operator<<(std::ostream &out, const DirectoryInfo &data); std::ostream &operator<<(std::ostream &out, const SynchronizationPackage &package); std::ostream &operator<<(std::ostream &out, FileType fileType); std::ostream &operator<<(std::ostream &out, ChangeLevel changeLevel); diff --git a/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp b/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp index cc3b4b705d3..b6a56cdda08 100644 --- a/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/projectstorage-test.cpp @@ -5123,220 +5123,220 @@ TEST_F(ProjectStorage, populate_module_cache) ASSERT_THAT(newStorage.module(id), IsModule("Qml", ModuleKind::QmlLibrary)); } -TEST_F(ProjectStorage, add_project_dataes) +TEST_F(ProjectStorage, add_directory_infoes) { - Storage::Synchronization::ProjectData projectData1{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo1{qmlProjectSourceId, sourceId1, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData2{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo2{qmlProjectSourceId, sourceId2, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData3{qtQuickProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo3{qtQuickProjectSourceId, sourceId3, qtQuickModuleId, Storage::Synchronization::FileType::QmlTypes}; storage.synchronize(SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, - {projectData1, projectData2, projectData3}}); + {directoryInfo1, directoryInfo2, directoryInfo3}}); - ASSERT_THAT(storage.fetchProjectDatas({qmlProjectSourceId, qtQuickProjectSourceId}), - UnorderedElementsAre(projectData1, projectData2, projectData3)); + ASSERT_THAT(storage.fetchDirectoryInfos({qmlProjectSourceId, qtQuickProjectSourceId}), + UnorderedElementsAre(directoryInfo1, directoryInfo2, directoryInfo3)); } -TEST_F(ProjectStorage, remove_project_data) +TEST_F(ProjectStorage, remove_directory_info) { - Storage::Synchronization::ProjectData projectData1{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo1{qmlProjectSourceId, sourceId1, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData2{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo2{qmlProjectSourceId, sourceId2, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData3{qtQuickProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo3{qtQuickProjectSourceId, sourceId3, qtQuickModuleId, Storage::Synchronization::FileType::QmlTypes}; storage.synchronize(SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, - {projectData1, projectData2, projectData3}}); + {directoryInfo1, directoryInfo2, directoryInfo3}}); storage.synchronize( - SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, {projectData1}}); + SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, {directoryInfo1}}); - ASSERT_THAT(storage.fetchProjectDatas({qmlProjectSourceId, qtQuickProjectSourceId}), - UnorderedElementsAre(projectData1)); + ASSERT_THAT(storage.fetchDirectoryInfos({qmlProjectSourceId, qtQuickProjectSourceId}), + UnorderedElementsAre(directoryInfo1)); } -TEST_F(ProjectStorage, update_project_data_file_type) +TEST_F(ProjectStorage, update_directory_info_file_type) { - Storage::Synchronization::ProjectData projectData1{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo1{qmlProjectSourceId, sourceId1, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData2{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo2{qmlProjectSourceId, sourceId2, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData2b{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo2b{qmlProjectSourceId, sourceId2, qmlModuleId, Storage::Synchronization::FileType::QmlTypes}; - Storage::Synchronization::ProjectData projectData3{qtQuickProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo3{qtQuickProjectSourceId, sourceId3, qtQuickModuleId, Storage::Synchronization::FileType::QmlTypes}; storage.synchronize(SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, - {projectData1, projectData2, projectData3}}); + {directoryInfo1, directoryInfo2, directoryInfo3}}); - storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1, projectData2b}}); + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {directoryInfo1, directoryInfo2b}}); - ASSERT_THAT(storage.fetchProjectDatas({qmlProjectSourceId, qtQuickProjectSourceId}), - UnorderedElementsAre(projectData1, projectData2b, projectData3)); + ASSERT_THAT(storage.fetchDirectoryInfos({qmlProjectSourceId, qtQuickProjectSourceId}), + UnorderedElementsAre(directoryInfo1, directoryInfo2b, directoryInfo3)); } -TEST_F(ProjectStorage, update_project_data_module_id) +TEST_F(ProjectStorage, update_directory_info_module_id) { - Storage::Synchronization::ProjectData projectData1{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo1{qmlProjectSourceId, sourceId1, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData2{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo2{qmlProjectSourceId, sourceId3, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData2b{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo2b{qmlProjectSourceId, sourceId3, qtQuickModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData3{qtQuickProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo3{qtQuickProjectSourceId, sourceId2, qtQuickModuleId, Storage::Synchronization::FileType::QmlTypes}; storage.synchronize(SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, - {projectData1, projectData2, projectData3}}); + {directoryInfo1, directoryInfo2, directoryInfo3}}); - storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1, projectData2b}}); + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {directoryInfo1, directoryInfo2b}}); - ASSERT_THAT(storage.fetchProjectDatas({qmlProjectSourceId, qtQuickProjectSourceId}), - UnorderedElementsAre(projectData1, projectData2b, projectData3)); + ASSERT_THAT(storage.fetchDirectoryInfos({qmlProjectSourceId, qtQuickProjectSourceId}), + UnorderedElementsAre(directoryInfo1, directoryInfo2b, directoryInfo3)); } -TEST_F(ProjectStorage, throw_for_invalid_source_id_in_project_data) +TEST_F(ProjectStorage, throw_for_invalid_source_id_in_directory_info) { - Storage::Synchronization::ProjectData projectData1{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo1{qmlProjectSourceId, SourceId{}, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - ASSERT_THROW(storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1}}), - QmlDesigner::ProjectDataHasInvalidSourceId); + ASSERT_THROW(storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {directoryInfo1}}), + QmlDesigner::DirectoryInfoHasInvalidSourceId); } -TEST_F(ProjectStorage, insert_project_data_with_invalid_module_id) +TEST_F(ProjectStorage, insert_directory_info_with_invalid_module_id) { - Storage::Synchronization::ProjectData projectData1{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo1{qmlProjectSourceId, sourceId1, ModuleId{}, Storage::Synchronization::FileType::QmlDocument}; - storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1}}); + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {directoryInfo1}}); - ASSERT_THAT(storage.fetchProjectDatas({qmlProjectSourceId, qtQuickProjectSourceId}), - UnorderedElementsAre(projectData1)); + ASSERT_THAT(storage.fetchDirectoryInfos({qmlProjectSourceId, qtQuickProjectSourceId}), + UnorderedElementsAre(directoryInfo1)); } -TEST_F(ProjectStorage, update_project_data_with_invalid_module_id) +TEST_F(ProjectStorage, update_directory_info_with_invalid_module_id) { - Storage::Synchronization::ProjectData projectData1{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo1{qmlProjectSourceId, sourceId1, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1}}); - projectData1.moduleId = ModuleId{}; + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {directoryInfo1}}); + directoryInfo1.moduleId = ModuleId{}; - storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1}}); + storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {directoryInfo1}}); - ASSERT_THAT(storage.fetchProjectDatas({qmlProjectSourceId, qtQuickProjectSourceId}), - UnorderedElementsAre(projectData1)); + ASSERT_THAT(storage.fetchDirectoryInfos({qmlProjectSourceId, qtQuickProjectSourceId}), + UnorderedElementsAre(directoryInfo1)); } -TEST_F(ProjectStorage, throw_for_updating_with_invalid_project_source_id_in_project_data) +TEST_F(ProjectStorage, throw_for_updating_with_invalid_project_source_id_in_directory_info) { - Storage::Synchronization::ProjectData projectData1{SourceId{}, + Storage::Synchronization::DirectoryInfo directoryInfo1{SourceId{}, sourceId1, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - ASSERT_THROW(storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {projectData1}}), - QmlDesigner::ProjectDataHasInvalidProjectSourceId); + ASSERT_THROW(storage.synchronize(SynchronizationPackage{{qmlProjectSourceId}, {directoryInfo1}}), + QmlDesigner::DirectoryInfoHasInvalidProjectSourceId); } -TEST_F(ProjectStorage, fetch_project_datas_by_directory_source_ids) +TEST_F(ProjectStorage, fetch_directory_infos_by_directory_source_ids) { - Storage::Synchronization::ProjectData projectData1{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo1{qmlProjectSourceId, sourceId1, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData2{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo2{qmlProjectSourceId, sourceId2, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData3{qtQuickProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo3{qtQuickProjectSourceId, sourceId3, qtQuickModuleId, Storage::Synchronization::FileType::QmlTypes}; storage.synchronize(SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, - {projectData1, projectData2, projectData3}}); + {directoryInfo1, directoryInfo2, directoryInfo3}}); - auto projectDatas = storage.fetchProjectDatas({qmlProjectSourceId, qtQuickProjectSourceId}); + auto directoryInfos = storage.fetchDirectoryInfos({qmlProjectSourceId, qtQuickProjectSourceId}); - ASSERT_THAT(projectDatas, UnorderedElementsAre(projectData1, projectData2, projectData3)); + ASSERT_THAT(directoryInfos, UnorderedElementsAre(directoryInfo1, directoryInfo2, directoryInfo3)); } -TEST_F(ProjectStorage, fetch_project_datas_by_directory_source_id) +TEST_F(ProjectStorage, fetch_directory_infos_by_directory_source_id) { - Storage::Synchronization::ProjectData projectData1{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo1{qmlProjectSourceId, sourceId1, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData2{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo2{qmlProjectSourceId, sourceId2, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData3{qtQuickProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo3{qtQuickProjectSourceId, sourceId3, qtQuickModuleId, Storage::Synchronization::FileType::QmlTypes}; storage.synchronize(SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, - {projectData1, projectData2, projectData3}}); + {directoryInfo1, directoryInfo2, directoryInfo3}}); - auto projectData = storage.fetchProjectDatas(qmlProjectSourceId); + auto directoryInfo = storage.fetchDirectoryInfos(qmlProjectSourceId); - ASSERT_THAT(projectData, UnorderedElementsAre(projectData1, projectData2)); + ASSERT_THAT(directoryInfo, UnorderedElementsAre(directoryInfo1, directoryInfo2)); } -TEST_F(ProjectStorage, fetch_project_data_by_source_ids) +TEST_F(ProjectStorage, fetch_directory_info_by_source_ids) { - Storage::Synchronization::ProjectData projectData1{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo1{qmlProjectSourceId, sourceId1, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData2{qmlProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo2{qmlProjectSourceId, sourceId2, qmlModuleId, Storage::Synchronization::FileType::QmlDocument}; - Storage::Synchronization::ProjectData projectData3{qtQuickProjectSourceId, + Storage::Synchronization::DirectoryInfo directoryInfo3{qtQuickProjectSourceId, sourceId3, qtQuickModuleId, Storage::Synchronization::FileType::QmlTypes}; storage.synchronize(SynchronizationPackage{{qmlProjectSourceId, qtQuickProjectSourceId}, - {projectData1, projectData2, projectData3}}); + {directoryInfo1, directoryInfo2, directoryInfo3}}); - auto projectData = storage.fetchProjectData({sourceId2}); + auto directoryInfo = storage.fetchDirectoryInfo({sourceId2}); - ASSERT_THAT(projectData, Eq(projectData2)); + ASSERT_THAT(directoryInfo, Eq(directoryInfo2)); } TEST_F(ProjectStorage, exclude_exported_types) diff --git a/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp b/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp index 103571822c4..ae97c8b5abe 100644 --- a/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/projectstorageupdater-test.cpp @@ -28,10 +28,10 @@ namespace Storage = QmlDesigner::Storage; using QmlDesigner::IdPaths; using QmlDesigner::Storage::Import; using QmlDesigner::Storage::ModuleKind; +using QmlDesigner::Storage::Synchronization::DirectoryInfo; using QmlDesigner::Storage::Synchronization::FileType; using QmlDesigner::Storage::Synchronization::IsAutoVersion; using QmlDesigner::Storage::Synchronization::ModuleExportedImport; -using QmlDesigner::Storage::Synchronization::ProjectData; using QmlDesigner::Storage::Synchronization::SynchronizationPackage; using QmlDesigner::Storage::TypeTraits; using QmlDesigner::Storage::TypeTraitsKind; @@ -96,21 +96,21 @@ MATCHER_P3(IsFileStatus, && fileStatus.lastModified == lastModified; } -MATCHER_P4(IsProjectData, - projectSourceId, +MATCHER_P4(IsDirectoryInfo, + directorySourceId, sourceId, moduleId, fileType, std::string(negation ? "isn't " : "is ") - + PrintToString(Storage::Synchronization::ProjectData{ - projectSourceId, sourceId, moduleId, fileType})) + + PrintToString(Storage::Synchronization::DirectoryInfo{ + directorySourceId, sourceId, moduleId, fileType})) { - const Storage::Synchronization::ProjectData &projectData = arg; + const Storage::Synchronization::DirectoryInfo &directoryInfo = arg; - return compareInvalidAreTrue(projectData.projectSourceId, projectSourceId) - && projectData.sourceId == sourceId - && compareInvalidAreTrue(projectData.moduleId, moduleId) - && projectData.fileType == fileType; + return compareInvalidAreTrue(directoryInfo.directorySourceId, directorySourceId) + && directoryInfo.sourceId == sourceId + && compareInvalidAreTrue(directoryInfo.moduleId, moduleId) + && directoryInfo.fileType == fileType; } MATCHER(PackageIsEmpty, std::string(negation ? "isn't empty" : "is empty")) @@ -118,7 +118,7 @@ MATCHER(PackageIsEmpty, std::string(negation ? "isn't empty" : "is empty")) const Storage::Synchronization::SynchronizationPackage &package = arg; return package.imports.empty() && package.types.empty() && package.fileStatuses.empty() - && package.updatedSourceIds.empty() && package.projectDatas.empty() + && package.updatedSourceIds.empty() && package.directoryInfos.empty() && package.updatedFileStatusSourceIds.empty() && package.updatedProjectSourceIds.empty() && package.moduleDependencies.empty() && package.updatedModuleDependencySourceIds.empty() && package.moduleExportedImports.empty() && package.updatedModuleIds.empty() @@ -282,14 +282,14 @@ public: ON_CALL(fileSystemMock, qmlFileNames(Eq(directoryPath))).WillByDefault(Return(qmlFileNames)); } - void setProjectDatas(SourceId directoryPathSourceId, - const QmlDesigner::Storage::Synchronization::ProjectDatas &projectDatas) + void setDirectoryInfos(SourceId directoryPathSourceId, + const QmlDesigner::Storage::Synchronization::DirectoryInfos &directoryInfos) { - ON_CALL(projectStorageMock, fetchProjectDatas(Eq(directoryPathSourceId))) - .WillByDefault(Return(projectDatas)); - for (const ProjectData &projectData : projectDatas) { - ON_CALL(projectStorageMock, fetchProjectData(Eq(projectData.sourceId))) - .WillByDefault(Return(std::optional{projectData})); + ON_CALL(projectStorageMock, fetchDirectoryInfos(Eq(directoryPathSourceId))) + .WillByDefault(Return(directoryInfos)); + for (const DirectoryInfo &directoryInfo : directoryInfos) { + ON_CALL(projectStorageMock, fetchDirectoryInfo(Eq(directoryInfo.sourceId))) + .WillByDefault(Return(std::optional{directoryInfo})); } } @@ -476,9 +476,9 @@ TEST_F(ProjectStorageUpdater, parse_qml_types) setContent(u"/path/example2.qmltypes", qmltypes2); EXPECT_CALL(qmlTypesParserMock, - parse(qmltypes, _, _, Field(&ProjectData::moduleId, exampleCppNativeModuleId))); + parse(qmltypes, _, _, Field(&DirectoryInfo::moduleId, exampleCppNativeModuleId))); EXPECT_CALL(qmlTypesParserMock, - parse(qmltypes2, _, _, Field(&ProjectData::moduleId, exampleCppNativeModuleId))); + parse(qmltypes2, _, _, Field(&DirectoryInfo::moduleId, exampleCppNativeModuleId))); updater.update(directories, {}, {}, {}); } @@ -516,11 +516,11 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_types) Field(&SynchronizationPackage::fileStatuses, UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 1, 21), IsFileStatus(qmltypesPathSourceId, 1, 21))), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmltypesPathSourceId, - exampleCppNativeModuleId, - FileType::QmlTypes))), + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmltypesPathSourceId, + exampleCppNativeModuleId, + FileType::QmlTypes))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId))))); @@ -655,19 +655,19 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents) IsFileStatus(qmlDocumentSourceId3, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId3, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId3, + ModuleId{}, + FileType::QmlDocument)))))); updater.update(directories, {}, {}, {}); } @@ -680,8 +680,8 @@ TEST_F(ProjectStorageUpdater, synchronize_add_only_qml_document_in_directory) setFilesChanged({directoryPathSourceId}); setFilesDontChanged({qmlDirPathSourceId, qmlDocumentSourceId1}); setFilesAdded({qmlDocumentSourceId2}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos(directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}}); setQmlFileNames(u"/path", {"First.qml", "First2.qml"}); EXPECT_CALL(projectStorageMock, @@ -715,15 +715,15 @@ TEST_F(ProjectStorageUpdater, synchronize_add_only_qml_document_in_directory) IsFileStatus(directoryPathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument)))))); updater.update(directories, {}, {}, {}); } @@ -738,10 +738,11 @@ TEST_F(ProjectStorageUpdater, synchronize_removes_qml_document) setFilesChanged({qmlDirPathSourceId}); setFilesDontChanged({qmlDocumentSourceId1, qmlDocumentSourceId2}); setFilesRemoved({qmlDocumentSourceId3}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId3, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos( + directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId3, ModuleId{}, FileType::QmlDocument}}); setQmlFileNames(u"/path", {"First.qml", "First2.qml"}); EXPECT_CALL(projectStorageMock, @@ -778,15 +779,15 @@ TEST_F(ProjectStorageUpdater, synchronize_removes_qml_document) UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument)))))); updater.update(directories, {}, {}, {}); } @@ -799,9 +800,9 @@ TEST_F(ProjectStorageUpdater, synchronize_removes_qml_document_in_qmldir_only) setContent(u"/path/qmldir", qmldir); setFilesChanged({qmlDirPathSourceId}); setFilesDontChanged({qmlDocumentSourceId1, qmlDocumentSourceId2}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos(directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); setQmlFileNames(u"/path", {"First.qml", "First2.qml"}); EXPECT_CALL( @@ -833,15 +834,15 @@ TEST_F(ProjectStorageUpdater, synchronize_removes_qml_document_in_qmldir_only) UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument)))))); updater.update(directories, {}, {}, {}); } @@ -855,9 +856,9 @@ TEST_F(ProjectStorageUpdater, synchronize_add_qml_document_to_qmldir) setContent(u"/path/qmldir", qmldir); setFilesChanged({qmlDirPathSourceId}); setFilesDontChanged({qmlDocumentSourceId1, qmlDocumentSourceId2}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos(directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); setQmlFileNames(u"/path", {"First.qml", "First2.qml"}); EXPECT_CALL( @@ -891,15 +892,15 @@ TEST_F(ProjectStorageUpdater, synchronize_add_qml_document_to_qmldir) UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument)))))); updater.update(directories, {}, {}, {}); } @@ -912,9 +913,9 @@ TEST_F(ProjectStorageUpdater, synchronize_remove_qml_document_from_qmldir) setContent(u"/path/qmldir", qmldir); setFilesDontChanged({qmlDocumentSourceId1, qmlDocumentSourceId2}); setFilesChanged({qmlDirPathSourceId}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos(directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); setQmlFileNames(u"/path", {"First.qml", "First2.qml"}); EXPECT_CALL( @@ -946,15 +947,15 @@ TEST_F(ProjectStorageUpdater, synchronize_remove_qml_document_from_qmldir) UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument)))))); updater.update(directories, {}, {}, {}); } @@ -1012,26 +1013,26 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_dont_update_if_up_to_dat UnorderedElementsAre(qmlDirPathSourceId, qmlDocumentSourceId1, qmlDocumentSourceId2)), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId3, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId3, + ModuleId{}, + FileType::QmlDocument)))))); updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_has_not_changed) { - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}, @@ -1075,14 +1076,14 @@ TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_has_not_changed) qmltypes2PathSourceId, qmlDocumentSourceId1, qmlDocumentSourceId2)), - Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + Field(&SynchronizationPackage::directoryInfos, IsEmpty())))); updater.update(directories, {}, {}, {}); } TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_has_not_changed_and_some_updated_files) { - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}, @@ -1110,7 +1111,7 @@ TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_has_not_changed_and_some IsFileStatus(qmlDocumentSourceId1, 1, 21))), Field(&SynchronizationPackage::updatedFileStatusSourceIds, UnorderedElementsAre(qmltypesPathSourceId, qmlDocumentSourceId1)), - Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + Field(&SynchronizationPackage::directoryInfos, IsEmpty())))); updater.update(directories, {}, {}, {}); } @@ -1118,7 +1119,7 @@ TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_has_not_changed_and_some TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_not_changed_and_some_removed_files) { setQmlFileNames(u"/path", {"First2.qml"}); - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}, @@ -1137,7 +1138,7 @@ TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_has_changed_and_some_rem typeinfo example2.qmltypes)"}; setContent(u"/path/qmldir", qmldir); setQmlFileNames(u"/path", {"First2.qml"}); - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}, @@ -1169,15 +1170,15 @@ TEST_F(ProjectStorageUpdater, synchroniz_if_qmldir_file_has_changed_and_some_rem UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedFileStatusSourceIds, UnorderedElementsAre(qmlDirPathSourceId, qmltypesPathSourceId, qmlDocumentSourceId1)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmltypes2PathSourceId, - exampleCppNativeModuleId, - FileType::QmlTypes)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmltypes2PathSourceId, + exampleCppNativeModuleId, + FileType::QmlTypes)))))); updater.update(directories, {}, {}, {}); } @@ -1191,7 +1192,7 @@ TEST_F(ProjectStorageUpdater, update_qml_types_files_is_empty) Field(&SynchronizationPackage::updatedSourceIds, IsEmpty()), Field(&SynchronizationPackage::fileStatuses, IsEmpty()), Field(&SynchronizationPackage::updatedFileStatusSourceIds, IsEmpty()), - Field(&SynchronizationPackage::projectDatas, IsEmpty()), + Field(&SynchronizationPackage::directoryInfos, IsEmpty()), Field(&SynchronizationPackage::updatedProjectSourceIds, IsEmpty())))); updater.update({}, {}, {}, {}); @@ -1210,15 +1211,15 @@ TEST_F(ProjectStorageUpdater, update_qml_types_files) IsFileStatus(qmltypes2PathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedFileStatusSourceIds, UnorderedElementsAre(qmltypesPathSourceId, qmltypes2PathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(qmltypesPathSourceId, - qmltypesPathSourceId, - builtinCppNativeModuleId, - FileType::QmlTypes), - IsProjectData(qmltypes2PathSourceId, - qmltypes2PathSourceId, - builtinCppNativeModuleId, - FileType::QmlTypes))), + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(qmltypesPathSourceId, + qmltypesPathSourceId, + builtinCppNativeModuleId, + FileType::QmlTypes), + IsDirectoryInfo(qmltypes2PathSourceId, + qmltypes2PathSourceId, + builtinCppNativeModuleId, + FileType::QmlTypes))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(qmltypesPathSourceId, qmltypes2PathSourceId))))); @@ -1239,11 +1240,11 @@ TEST_F(ProjectStorageUpdater, dont_update_qml_types_files_if_unchanged) UnorderedElementsAre(IsFileStatus(qmltypesPathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedFileStatusSourceIds, UnorderedElementsAre(qmltypesPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(qmltypesPathSourceId, - qmltypesPathSourceId, - builtinCppNativeModuleId, - FileType::QmlTypes))), + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(qmltypesPathSourceId, + qmltypesPathSourceId, + builtinCppNativeModuleId, + FileType::QmlTypes))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(qmltypesPathSourceId))))); @@ -1284,11 +1285,11 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_with_different_version_b IsFileStatus(qmlDocumentSourceId1, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument)))))); updater.update(directories, {}, {}, {}); } @@ -1325,11 +1326,11 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_with_different_type_name IsFileStatus(qmlDocumentSourceId1, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument)))))); updater.update(directories, {}, {}, {}); } @@ -1750,11 +1751,11 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_only_qml_files_changed) { setFilesDontChanged({qmldir1SourceId, qmldir2SourceId, path1SourceId, path2SourceId}); setFilesChanged({firstSourceId, secondSourceId, thirdSourceId}); - setProjectDatas(path1SourceId, - {{path1SourceId, firstSourceId, exampleModuleId, FileType::QmlDocument}, - {path1SourceId, secondSourceId, exampleModuleId, FileType::QmlDocument}}); - setProjectDatas(path2SourceId, - {{path2SourceId, thirdSourceId, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos(path1SourceId, + {{path1SourceId, firstSourceId, exampleModuleId, FileType::QmlDocument}, + {path1SourceId, secondSourceId, exampleModuleId, FileType::QmlDocument}}); + setDirectoryInfos(path2SourceId, + {{path2SourceId, thirdSourceId, ModuleId{}, FileType::QmlDocument}}); EXPECT_CALL(patchWatcherMock, updateIdPaths(Contains(IdPaths{projectPartId, @@ -1773,11 +1774,11 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_qml_files_and_directories_dont firstSourceId, secondSourceId, thirdSourceId}); - setProjectDatas(path1SourceId, - {{path1SourceId, firstSourceId, exampleModuleId, FileType::QmlDocument}, - {path1SourceId, secondSourceId, exampleModuleId, FileType::QmlDocument}}); - setProjectDatas(path2SourceId, - {{path2SourceId, thirdSourceId, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos(path1SourceId, + {{path1SourceId, firstSourceId, exampleModuleId, FileType::QmlDocument}, + {path1SourceId, secondSourceId, exampleModuleId, FileType::QmlDocument}}); + setDirectoryInfos(path2SourceId, + {{path2SourceId, thirdSourceId, ModuleId{}, FileType::QmlDocument}}); EXPECT_CALL(patchWatcherMock, updateIdPaths(Contains(IdPaths{projectPartId, @@ -1828,10 +1829,10 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_only_qmltypes_files_changed) { setFilesDontChanged({qmldir1SourceId, qmldir2SourceId, path1SourceId, path2SourceId}); setFilesChanged({qmltypes1SourceId, qmltypes2SourceId}); - setProjectDatas(path1SourceId, - {{path1SourceId, qmltypes1SourceId, exampleModuleId, FileType::QmlTypes}}); - setProjectDatas(path2SourceId, - {{path2SourceId, qmltypes2SourceId, exampleModuleId, FileType::QmlTypes}}); + setDirectoryInfos(path1SourceId, + {{path1SourceId, qmltypes1SourceId, exampleModuleId, FileType::QmlTypes}}); + setDirectoryInfos(path2SourceId, + {{path2SourceId, qmltypes2SourceId, exampleModuleId, FileType::QmlTypes}}); EXPECT_CALL(patchWatcherMock, updateIdPaths(Contains(IdPaths{projectPartId, @@ -1849,10 +1850,10 @@ TEST_F(ProjectStorageUpdater, update_path_watcher_qmltypes_files_and_directories path2SourceId, qmltypes1SourceId, qmltypes2SourceId}); - setProjectDatas(path1SourceId, - {{path1SourceId, qmltypes1SourceId, exampleModuleId, FileType::QmlTypes}}); - setProjectDatas(path2SourceId, - {{path2SourceId, qmltypes2SourceId, exampleModuleId, FileType::QmlTypes}}); + setDirectoryInfos(path1SourceId, + {{path1SourceId, qmltypes1SourceId, exampleModuleId, FileType::QmlTypes}}); + setDirectoryInfos(path2SourceId, + {{path2SourceId, qmltypes2SourceId, exampleModuleId, FileType::QmlTypes}}); EXPECT_CALL(patchWatcherMock, updateIdPaths(Contains(IdPaths{projectPartId, @@ -1927,19 +1928,19 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir) IsFileStatus(qmlDocumentSourceId3, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId3, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId3, + ModuleId{}, + FileType::QmlDocument)))))); updater.update(directories, {}, {}, {}); } @@ -1955,10 +1956,11 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_throws_if TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_throws_if_directory_does_not_exists) { setFilesDontExists({qmlDirPathSourceId, directoryPathSourceId}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId3, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos( + directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId3, ModuleId{}, FileType::QmlDocument}}); EXPECT_CALL(projectStorageMock, synchronize(AllOf(Field(&SynchronizationPackage::imports, IsEmpty()), @@ -1977,7 +1979,7 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_throws_if Field(&SynchronizationPackage::fileStatuses, IsEmpty()), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + Field(&SynchronizationPackage::directoryInfos, IsEmpty())))); updater.update(directories, {}, {}, {}); } @@ -1988,9 +1990,9 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_add_qml_d setFilesChanged({directoryPathSourceId}); setFilesAdded({qmlDocumentSourceId3}); setFilesDontChanged({qmlDocumentSourceId1, qmlDocumentSourceId2}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos(directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); EXPECT_CALL( projectStorageMock, @@ -2014,19 +2016,19 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_add_qml_d IsFileStatus(qmlDocumentSourceId3, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId3, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId3, + ModuleId{}, + FileType::QmlDocument)))))); updater.update(directories, {}, {}, {}); } @@ -2038,10 +2040,11 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_removes_q setFilesRemoved({qmlDocumentSourceId3}); setFilesDontChanged({qmlDocumentSourceId1, qmlDocumentSourceId2}); setQmlFileNames(u"/path", {"First.qml", "First2.qml"}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId3, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos( + directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId3, ModuleId{}, FileType::QmlDocument}}); EXPECT_CALL(projectStorageMock, synchronize( @@ -2057,15 +2060,15 @@ TEST_F(ProjectStorageUpdater, synchronize_qml_documents_without_qmldir_removes_q UnorderedElementsAre(IsFileStatus(directoryPathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument)))))); updater.update(directories, {}, {}, {}); } @@ -2125,19 +2128,19 @@ TEST_F(ProjectStorageUpdater, watcher_updates_directories) IsFileStatus(qmlDocumentSourceId3, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId3, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId3, + ModuleId{}, + FileType::QmlDocument)))))); updater.pathsWithIdsChanged({{directoryProjectChunkId, {directoryPathSourceId}}}); } @@ -2149,10 +2152,11 @@ TEST_F(ProjectStorageUpdater, watcher_updates_removed_directory) qmlDocumentSourceId1, qmlDocumentSourceId2, qmlDocumentSourceId3}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId3, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos( + directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId3, ModuleId{}, FileType::QmlDocument}}); EXPECT_CALL(projectStorageMock, synchronize(AllOf(Field(&SynchronizationPackage::imports, IsEmpty()), @@ -2171,7 +2175,7 @@ TEST_F(ProjectStorageUpdater, watcher_updates_removed_directory) Field(&SynchronizationPackage::fileStatuses, UnorderedElementsAre()), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + Field(&SynchronizationPackage::directoryInfos, IsEmpty())))); updater.pathsWithIdsChanged({{directoryProjectChunkId, {directoryPathSourceId}}}); } @@ -2273,19 +2277,19 @@ TEST_F(ProjectStorageUpdater, watcher_updates_directories_and_qmldir) IsFileStatus(qmlDocumentSourceId3, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId3, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId3, + ModuleId{}, + FileType::QmlDocument)))))); updater.pathsWithIdsChanged({{directoryProjectChunkId, {directoryPathSourceId}}, {qmldirProjectChunkId, {qmlDirPathSourceId}}}); @@ -2335,8 +2339,8 @@ TEST_F(ProjectStorageUpdater, watcher_updates_add_only_qml_document_in_directory setFilesChanged({directoryPathSourceId}); setFilesDontChanged({qmlDirPathSourceId, qmlDocumentSourceId1}); setFilesAdded({qmlDocumentSourceId2}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos(directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}}); setQmlFileNames(u"/path", {"First.qml", "First2.qml"}); EXPECT_CALL(projectStorageMock, @@ -2370,15 +2374,15 @@ TEST_F(ProjectStorageUpdater, watcher_updates_add_only_qml_document_in_directory IsFileStatus(directoryPathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument)))))); updater.pathsWithIdsChanged({{directoryProjectChunkId, {directoryPathSourceId}}}); } @@ -2393,10 +2397,11 @@ TEST_F(ProjectStorageUpdater, watcher_updates_removes_qml_document) setFilesChanged({qmlDirPathSourceId}); setFilesDontChanged({qmlDocumentSourceId1, qmlDocumentSourceId2}); setFilesRemoved({qmlDocumentSourceId3}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId3, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos( + directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId3, ModuleId{}, FileType::QmlDocument}}); setQmlFileNames(u"/path", {"First.qml", "First2.qml"}); EXPECT_CALL(projectStorageMock, @@ -2433,15 +2438,15 @@ TEST_F(ProjectStorageUpdater, watcher_updates_removes_qml_document) UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument)))))); updater.pathsWithIdsChanged({{directoryProjectChunkId, {directoryPathSourceId}}}); } @@ -2454,9 +2459,9 @@ TEST_F(ProjectStorageUpdater, watcher_updates_removes_qml_document_in_qmldir_onl setContent(u"/path/qmldir", qmldir); setFilesChanged({qmlDirPathSourceId}); setFilesDontChanged({qmlDocumentSourceId1, qmlDocumentSourceId2}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos(directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); setQmlFileNames(u"/path", {"First.qml", "First2.qml"}); EXPECT_CALL( @@ -2488,15 +2493,15 @@ TEST_F(ProjectStorageUpdater, watcher_updates_removes_qml_document_in_qmldir_onl UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument)))))); updater.pathsWithIdsChanged({{qmldirProjectChunkId, {qmlDirPathSourceId}}}); } @@ -2510,9 +2515,9 @@ TEST_F(ProjectStorageUpdater, watcher_updates_directories_add_qml_document_to_qm setContent(u"/path/qmldir", qmldir); setFilesChanged({qmlDirPathSourceId}); setFilesDontChanged({qmlDocumentSourceId1, qmlDocumentSourceId2}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos(directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); setQmlFileNames(u"/path", {"First.qml", "First2.qml"}); EXPECT_CALL( @@ -2546,15 +2551,15 @@ TEST_F(ProjectStorageUpdater, watcher_updates_directories_add_qml_document_to_qm UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument)))))); updater.pathsWithIdsChanged({{qmldirProjectChunkId, {qmlDirPathSourceId}}}); } @@ -2567,9 +2572,9 @@ TEST_F(ProjectStorageUpdater, watcher_updates_directories_remove_qml_document_fr setContent(u"/path/qmldir", qmldir); setFilesDontChanged({qmlDocumentSourceId1, qmlDocumentSourceId2}); setFilesChanged({qmlDirPathSourceId}); - setProjectDatas(directoryPathSourceId, - {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, - {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); + setDirectoryInfos(directoryPathSourceId, + {{directoryPathSourceId, qmlDocumentSourceId1, ModuleId{}, FileType::QmlDocument}, + {directoryPathSourceId, qmlDocumentSourceId2, ModuleId{}, FileType::QmlDocument}}); setQmlFileNames(u"/path", {"First.qml", "First2.qml"}); EXPECT_CALL( @@ -2601,15 +2606,15 @@ TEST_F(ProjectStorageUpdater, watcher_updates_directories_remove_qml_document_fr UnorderedElementsAre(IsFileStatus(qmlDirPathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument)))))); updater.pathsWithIdsChanged({{qmldirProjectChunkId, {qmlDirPathSourceId}}}); } @@ -2667,19 +2672,19 @@ TEST_F(ProjectStorageUpdater, watcher_updates_directories_dont_update_qml_docume UnorderedElementsAre(qmlDirPathSourceId, qmlDocumentSourceId1, qmlDocumentSourceId2)), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId3, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId3, + ModuleId{}, + FileType::QmlDocument)))))); updater.pathsWithIdsChanged({{directoryProjectChunkId, {directoryPathSourceId}}}); } @@ -2737,26 +2742,26 @@ TEST_F(ProjectStorageUpdater, watcher_updates_qmldirs_dont_update_qml_documents_ UnorderedElementsAre(qmlDirPathSourceId, qmlDocumentSourceId1, qmlDocumentSourceId2)), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId3, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId3, + ModuleId{}, + FileType::QmlDocument)))))); updater.pathsWithIdsChanged({{qmldirProjectChunkId, {qmlDirPathSourceId}}}); } TEST_F(ProjectStorageUpdater, watcher_updates_directory_but_not_qmldir) { - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}, @@ -2800,7 +2805,7 @@ TEST_F(ProjectStorageUpdater, watcher_updates_directory_but_not_qmldir) qmltypes2PathSourceId, qmlDocumentSourceId1, qmlDocumentSourceId2)), - Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + Field(&SynchronizationPackage::directoryInfos, IsEmpty())))); updater.pathsWithIdsChanged({{directoryProjectChunkId, {directoryPathSourceId}}}); } @@ -2832,7 +2837,7 @@ TEST_F(ProjectStorageUpdater, watcher_updates_qml_documents) IsFileStatus(qmlDocumentSourceId2, 1, 21))), Field(&SynchronizationPackage::updatedFileStatusSourceIds, UnorderedElementsAre(qmlDocumentSourceId1, qmlDocumentSourceId2)), - Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + Field(&SynchronizationPackage::directoryInfos, IsEmpty())))); updater.pathsWithIdsChanged( {{qmlDocumentProjectChunkId, {qmlDocumentSourceId1, qmlDocumentSourceId2}}}); @@ -2859,7 +2864,7 @@ TEST_F(ProjectStorageUpdater, watcher_updates_removed_qml_documents) UnorderedElementsAre(IsFileStatus(qmlDocumentSourceId1, 1, 21))), Field(&SynchronizationPackage::updatedFileStatusSourceIds, UnorderedElementsAre(qmlDocumentSourceId1, qmlDocumentSourceId2)), - Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + Field(&SynchronizationPackage::directoryInfos, IsEmpty())))); updater.pathsWithIdsChanged( {{qmlDocumentProjectChunkId, {qmlDocumentSourceId1, qmlDocumentSourceId2}}}); @@ -2882,7 +2887,7 @@ TEST_F(ProjectStorageUpdater, watcher_dont_updates_qml_documents_for_other_proje TEST_F(ProjectStorageUpdater, watcher_updates_qmltypes) { - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}}); @@ -2902,7 +2907,7 @@ TEST_F(ProjectStorageUpdater, watcher_updates_qmltypes) IsFileStatus(qmltypes2PathSourceId, 1, 21))), Field(&SynchronizationPackage::updatedFileStatusSourceIds, UnorderedElementsAre(qmltypesPathSourceId, qmltypes2PathSourceId)), - Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + Field(&SynchronizationPackage::directoryInfos, IsEmpty())))); updater.pathsWithIdsChanged( {{qmltypesProjectChunkId, {qmltypesPathSourceId, qmltypes2PathSourceId}}}); @@ -2910,7 +2915,7 @@ TEST_F(ProjectStorageUpdater, watcher_updates_qmltypes) TEST_F(ProjectStorageUpdater, watcher_updates_removed_qmltypes_without_updated_qmldir) { - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}}); @@ -2926,7 +2931,7 @@ TEST_F(ProjectStorageUpdater, watcher_updates_removed_qmltypes_without_updated_q TEST_F(ProjectStorageUpdater, watcher_updates_removed_qmltypes_with_updated_qmldir) { - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}}); @@ -2956,18 +2961,18 @@ TEST_F(ProjectStorageUpdater, watcher_updates_removed_qmltypes_with_updated_qmld UnorderedElementsAre(qmlDirPathSourceId, qmltypesPathSourceId, qmltypes2PathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmltypes2PathSourceId, - exampleCppNativeModuleId, - FileType::QmlTypes)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmltypes2PathSourceId, + exampleCppNativeModuleId, + FileType::QmlTypes)))))); updater.pathsWithIdsChanged({{qmldirProjectChunkId, {qmlDirPathSourceId}}}); } TEST_F(ProjectStorageUpdater, watcher_dont_watches_directories_after_qmltypes_changes) { - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}}); @@ -2982,7 +2987,7 @@ TEST_F(ProjectStorageUpdater, watcher_dont_watches_directories_after_qmltypes_ch TEST_F(ProjectStorageUpdater, watcher_dont_updates_qmltypes_for_other_projects) { - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}}); @@ -3050,19 +3055,19 @@ TEST_F(ProjectStorageUpdater, watcher_updates_directories_and_but_not_included_q IsFileStatus(qmlDocumentSourceId3, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId3, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId3, + ModuleId{}, + FileType::QmlDocument)))))); updater.pathsWithIdsChanged({{directoryProjectChunkId, {directoryPathSourceId}}, {qmlDocumentProjectChunkId, @@ -3127,19 +3132,19 @@ TEST_F(ProjectStorageUpdater, watcher_updates_qmldir_and_but_not_included_qml_do IsFileStatus(qmlDocumentSourceId3, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId3, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId3, + ModuleId{}, + FileType::QmlDocument)))))); updater.pathsWithIdsChanged({{qmldirProjectChunkId, {qmlDirPathSourceId}}, {qmlDocumentProjectChunkId, @@ -3148,7 +3153,7 @@ TEST_F(ProjectStorageUpdater, watcher_updates_qmldir_and_but_not_included_qml_do TEST_F(ProjectStorageUpdater, watcher_updates_qmldir_and_but_not_included_qmltypes) { - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}, @@ -3226,27 +3231,27 @@ TEST_F(ProjectStorageUpdater, watcher_updates_qmldir_and_but_not_included_qmltyp IsFileStatus(qmlDocumentSourceId3, 1, 21))), Field(&SynchronizationPackage::updatedProjectSourceIds, UnorderedElementsAre(directoryPathSourceId)), - Field(&SynchronizationPackage::projectDatas, - UnorderedElementsAre(IsProjectData(directoryPathSourceId, - qmltypesPathSourceId, - exampleCppNativeModuleId, - FileType::QmlTypes), - IsProjectData(directoryPathSourceId, - qmltypes2PathSourceId, - exampleCppNativeModuleId, - FileType::QmlTypes), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId1, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId2, - ModuleId{}, - FileType::QmlDocument), - IsProjectData(directoryPathSourceId, - qmlDocumentSourceId3, - ModuleId{}, - FileType::QmlDocument)))))); + Field(&SynchronizationPackage::directoryInfos, + UnorderedElementsAre(IsDirectoryInfo(directoryPathSourceId, + qmltypesPathSourceId, + exampleCppNativeModuleId, + FileType::QmlTypes), + IsDirectoryInfo(directoryPathSourceId, + qmltypes2PathSourceId, + exampleCppNativeModuleId, + FileType::QmlTypes), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId1, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId2, + ModuleId{}, + FileType::QmlDocument), + IsDirectoryInfo(directoryPathSourceId, + qmlDocumentSourceId3, + ModuleId{}, + FileType::QmlDocument)))))); updater.pathsWithIdsChanged( {{qmldirProjectChunkId, {qmlDirPathSourceId}}, @@ -3274,7 +3279,7 @@ TEST_F(ProjectStorageUpdater, input_is_reused_next_call_if_an_error_happens) FirstType 2.2 First2.qml SecondType 2.2 Second.qml)"}; setContent(u"/path/qmldir", qmldir); - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}}); @@ -3321,7 +3326,7 @@ TEST_F(ProjectStorageUpdater, input_is_reused_next_call_if_an_error_happens) qmlDocumentSourceId2, qmltypesPathSourceId, qmltypes2PathSourceId)), - Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + Field(&SynchronizationPackage::directoryInfos, IsEmpty())))); updater.pathsWithIdsChanged( {{qmlDocumentProjectChunkId, {qmlDocumentSourceId1, qmlDocumentSourceId2}}}); @@ -3334,7 +3339,7 @@ TEST_F(ProjectStorageUpdater, input_is_reused_next_call_if_an_error_happens_and_ FirstType 2.2 First2.qml SecondType 2.2 Second.qml)"}; setContent(u"/path/qmldir", qmldir); - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}}); @@ -3381,7 +3386,7 @@ TEST_F(ProjectStorageUpdater, input_is_reused_next_call_if_an_error_happens_and_ qmlDocumentSourceId2, qmltypesPathSourceId, qmltypes2PathSourceId)), - Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + Field(&SynchronizationPackage::directoryInfos, IsEmpty())))); updater.pathsWithIdsChanged( {{qmltypesProjectChunkId, {qmltypesPathSourceId, qmltypes2PathSourceId}}, @@ -3395,7 +3400,7 @@ TEST_F(ProjectStorageUpdater, input_is_reused_next_call_if_an_error_happens_and_ FirstType 2.2 First2.qml SecondType 2.2 Second.qml)"}; setContent(u"/path/qmldir", qmldir); - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}, @@ -3444,7 +3449,7 @@ TEST_F(ProjectStorageUpdater, input_is_reused_next_call_if_an_error_happens_and_ qmlDocumentSourceId2, qmltypesPathSourceId, qmltypes2PathSourceId)), - Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + Field(&SynchronizationPackage::directoryInfos, IsEmpty())))); updater.pathsWithIdsChanged( {{qmltypesProjectChunkId, {qmltypesPathSourceId, qmltypes2PathSourceId}}, @@ -3458,7 +3463,7 @@ TEST_F(ProjectStorageUpdater, input_is_cleared_after_successful_update) FirstType 2.2 First2.qml SecondType 2.2 Second.qml)"}; setContent(u"/path/qmldir", qmldir); - setProjectDatas( + setDirectoryInfos( directoryPathSourceId, {{directoryPathSourceId, qmltypesPathSourceId, exampleModuleId, FileType::QmlTypes}, {directoryPathSourceId, qmltypes2PathSourceId, exampleModuleId, FileType::QmlTypes}}); @@ -3491,7 +3496,7 @@ TEST_F(ProjectStorageUpdater, input_is_cleared_after_successful_update) IsFileStatus(qmlDocumentSourceId2, 1, 21))), Field(&SynchronizationPackage::updatedFileStatusSourceIds, UnorderedElementsAre(qmlDocumentSourceId1, qmlDocumentSourceId2)), - Field(&SynchronizationPackage::projectDatas, IsEmpty())))); + Field(&SynchronizationPackage::directoryInfos, IsEmpty())))); updater.pathsWithIdsChanged( {{qmlDocumentProjectChunkId, {qmlDocumentSourceId1, qmlDocumentSourceId2}}}); diff --git a/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp b/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp index 3acddb12a09..aeb68cc2d6c 100644 --- a/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp +++ b/tests/unit/tests/unittests/projectstorage/qmltypesparser-test.cpp @@ -177,7 +177,7 @@ protected: Synchronization::Types types; SourceId qmltypesFileSourceId{sourcePathCache.sourceId("path/to/types.qmltypes")}; ModuleId qtQmlNativeModuleId = storage.moduleId("QtQml", ModuleKind::CppLibrary); - Synchronization::ProjectData projectData{qmltypesFileSourceId, + Synchronization::DirectoryInfo directoryInfo{qmltypesFileSourceId, qmltypesFileSourceId, qtQmlNativeModuleId, Synchronization::FileType::QmlTypes}; @@ -191,7 +191,7 @@ TEST_F(QmlTypesParser, imports) dependencies: ["QtQuick 2.15", "QtQuick.Window 2.1", "QtFoo 6"]})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(imports, UnorderedElementsAre(IsImport(storage.moduleId("QML", ModuleKind::CppLibrary), @@ -218,7 +218,7 @@ TEST_F(QmlTypesParser, types) Component { name: "QObject"} Component { name: "QQmlComponent"}})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, UnorderedElementsAre(IsType("QObject", @@ -241,7 +241,7 @@ TEST_F(QmlTypesParser, prototype) Component { name: "QQmlComponent" prototype: "QObject"}})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, UnorderedElementsAre(IsType("QObject", @@ -264,7 +264,7 @@ TEST_F(QmlTypesParser, extension) Component { name: "QQmlComponent" extension: "QObject"}})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, UnorderedElementsAre(IsType("QObject", @@ -289,7 +289,7 @@ TEST_F(QmlTypesParser, exported_types) ModuleId qmlModuleId = storage.moduleId("QML", ModuleKind::QmlLibrary); ModuleId qtQmlModuleId = storage.moduleId("QtQml", ModuleKind::QmlLibrary); - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT( types, @@ -312,7 +312,7 @@ TEST_F(QmlTypesParser, properties) Property { name: "targets"; type: "QQuickItem"; isList: true; isReadonly: true; isPointer: true } }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, ElementsAre(Field( @@ -346,7 +346,7 @@ TEST_F(QmlTypesParser, properties_with_qualified_types) Property { name: "values2"; type: "Qt::Vector" } }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, Contains( @@ -372,7 +372,7 @@ TEST_F(QmlTypesParser, properties_without_type) Property { name: "target"; type: "QObject"; isPointer: true } }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, ElementsAre( @@ -405,7 +405,7 @@ TEST_F(QmlTypesParser, functions) } }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, ElementsAre(Field( @@ -436,7 +436,7 @@ TEST_F(QmlTypesParser, skip_java_script_functions) } }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, ElementsAre(Field(&Synchronization::Type::functionDeclarations, IsEmpty()))); } @@ -456,7 +456,7 @@ TEST_F(QmlTypesParser, functions_with_qualified_types) } }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, Contains( @@ -491,7 +491,7 @@ TEST_F(QmlTypesParser, signals) } }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, ElementsAre(Field(&Synchronization::Type::signalDeclarations, @@ -524,7 +524,7 @@ TEST_F(QmlTypesParser, signals_with_qualified_types) } }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, Contains( @@ -557,7 +557,7 @@ TEST_F(QmlTypesParser, enumerations) } }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, Contains(Field( @@ -596,7 +596,7 @@ TEST_F(QmlTypesParser, enumeration_is_exported_as_type) exports: ["QML/QtObject 1.0", "QtQml/QtObject 2.1"] }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); QmlDesigner::Storage::TypeTraits traits{QmlDesigner::Storage::TypeTraitsKind::Value}; traits.isEnum = true; @@ -642,7 +642,7 @@ TEST_F(QmlTypesParser, enumeration_is_exported_as_type_with_alias) exports: ["QML/QtObject 1.0", "QtQml/QtObject 2.1"] }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); QmlDesigner::Storage::TypeTraits traits{QmlDesigner::Storage::TypeTraitsKind::Value}; traits.isEnum = true; @@ -690,7 +690,7 @@ TEST_F(QmlTypesParser, enumeration_is_exported_as_type_with_alias_too) exports: ["QML/QtObject 1.0", "QtQml/QtObject 2.1"] }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); QmlDesigner::Storage::TypeTraits traits{QmlDesigner::Storage::TypeTraitsKind::Value}; traits.isEnum = true; @@ -728,7 +728,7 @@ TEST_F(QmlTypesParser, enumeration_is_referenced_by_qualified_name) } }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, Contains(Field(&Synchronization::Type::propertyDeclarations, @@ -756,7 +756,7 @@ TEST_F(QmlTypesParser, alias_enumeration_is_referenced_by_qualified_name) } }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, Contains(Field(&Synchronization::Type::propertyDeclarations, @@ -773,7 +773,7 @@ TEST_F(QmlTypesParser, access_type_is_reference) Component { name: "QObject" accessSemantics: "reference"}})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, ElementsAre(IsTypeTrait(Storage::TypeTraitsKind::Reference))); } @@ -785,7 +785,7 @@ TEST_F(QmlTypesParser, access_type_is_value) Component { name: "QObject" accessSemantics: "value"}})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, ElementsAre(IsTypeTrait(Storage::TypeTraitsKind::Value))); } @@ -797,7 +797,7 @@ TEST_F(QmlTypesParser, access_type_is_sequence) Component { name: "QObject" accessSemantics: "sequence"}})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, ElementsAre(IsTypeTrait(Storage::TypeTraitsKind::Sequence))); } @@ -809,7 +809,7 @@ TEST_F(QmlTypesParser, access_type_is_none) Component { name: "QObject" accessSemantics: "none"}})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, ElementsAre(IsTypeTrait(Storage::TypeTraitsKind::None))); } @@ -821,7 +821,7 @@ TEST_F(QmlTypesParser, uses_custom_parser) Component { name: "QObject" hasCustomParser: true }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, ElementsAre(IsTypeTrait(UsesCustomParser(true)))); } @@ -833,7 +833,7 @@ TEST_F(QmlTypesParser, uses_no_custom_parser) Component { name: "QObject" hasCustomParser: false }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, ElementsAre(IsTypeTrait(UsesCustomParser(false)))); } @@ -845,7 +845,7 @@ TEST_F(QmlTypesParser, default_property) Component { name: "QObject" defaultProperty: "children" }})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, ElementsAre(Field(&Synchronization::Type::defaultPropertyName, Eq("children")))); @@ -854,7 +854,7 @@ TEST_F(QmlTypesParser, default_property) TEST_F(QmlTypesParser, skip_template_item) { ModuleId moduleId = storage.moduleId("QtQuick.Templates", ModuleKind::CppLibrary); - Synchronization::ProjectData projectData{qmltypesFileSourceId, + Synchronization::DirectoryInfo directoryInfo{qmltypesFileSourceId, qmltypesFileSourceId, moduleId, Synchronization::FileType::QmlTypes}; @@ -863,7 +863,7 @@ TEST_F(QmlTypesParser, skip_template_item) Component { name: "QQuickItem"} Component { name: "QQmlComponent"}})"}; - parser.parse(source, imports, types, projectData); + parser.parse(source, imports, types, directoryInfo); ASSERT_THAT(types, UnorderedElementsAre(IsType("QQmlComponent",