forked from qt-creator/qt-creator
QmlDesigner: Rename TypeAccessSemantics into TypeTraits
We can save more data into that enumeration but the name should reflect that. Task-number: QDS-7327 Change-Id: I35a4e1460a6bbc63b32934828b766733a92c5ba7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -1731,7 +1731,7 @@ private:
|
|||||||
|
|
||||||
type.typeId = upsertTypeStatement.template value<TypeId>(type.sourceId,
|
type.typeId = upsertTypeStatement.template value<TypeId>(type.sourceId,
|
||||||
type.typeName,
|
type.typeName,
|
||||||
type.accessSemantics);
|
type.traits);
|
||||||
|
|
||||||
if (!type.typeId)
|
if (!type.typeId)
|
||||||
type.typeId = selectTypeIdBySourceIdAndNameStatement.template value<TypeId>(type.sourceId,
|
type.typeId = selectTypeIdBySourceIdAndNameStatement.template value<TypeId>(type.sourceId,
|
||||||
@@ -2230,7 +2230,7 @@ private:
|
|||||||
typesTable.addColumn("typeId", Sqlite::StrictColumnType::Integer, {Sqlite::PrimaryKey{}});
|
typesTable.addColumn("typeId", Sqlite::StrictColumnType::Integer, {Sqlite::PrimaryKey{}});
|
||||||
auto &sourceIdColumn = typesTable.addColumn("sourceId", Sqlite::StrictColumnType::Integer);
|
auto &sourceIdColumn = typesTable.addColumn("sourceId", Sqlite::StrictColumnType::Integer);
|
||||||
auto &typesNameColumn = typesTable.addColumn("name", Sqlite::StrictColumnType::Text);
|
auto &typesNameColumn = typesTable.addColumn("name", Sqlite::StrictColumnType::Text);
|
||||||
typesTable.addColumn("accessSemantics", Sqlite::StrictColumnType::Integer);
|
typesTable.addColumn("traits", Sqlite::StrictColumnType::Integer);
|
||||||
typesTable.addForeignKeyColumn("prototypeId",
|
typesTable.addForeignKeyColumn("prototypeId",
|
||||||
typesTable,
|
typesTable,
|
||||||
Sqlite::ForeignKeyAction::NoAction,
|
Sqlite::ForeignKeyAction::NoAction,
|
||||||
@@ -2517,9 +2517,9 @@ public:
|
|||||||
Initializer initializer;
|
Initializer initializer;
|
||||||
ModuleCache moduleCache{ModuleStorageAdapter{*this}};
|
ModuleCache moduleCache{ModuleStorageAdapter{*this}};
|
||||||
ReadWriteStatement<1, 3> upsertTypeStatement{
|
ReadWriteStatement<1, 3> upsertTypeStatement{
|
||||||
"INSERT INTO types(sourceId, name, accessSemantics) VALUES(?1, ?2, ?3) ON CONFLICT DO "
|
"INSERT INTO types(sourceId, name, traits) VALUES(?1, ?2, ?3) ON CONFLICT DO "
|
||||||
"UPDATE SET accessSemantics=excluded.accessSemantics WHERE accessSemantics IS NOT "
|
"UPDATE SET traits=excluded.traits WHERE traits IS NOT "
|
||||||
"excluded.accessSemantics RETURNING typeId",
|
"excluded.traits RETURNING typeId",
|
||||||
database};
|
database};
|
||||||
WriteStatement<3> updatePrototypeStatement{
|
WriteStatement<3> updatePrototypeStatement{
|
||||||
"UPDATE types SET prototypeId=?2, prototypeNameId=?3 WHERE typeId=?1 AND (prototypeId IS "
|
"UPDATE types SET prototypeId=?2, prototypeNameId=?3 WHERE typeId=?1 AND (prototypeId IS "
|
||||||
@@ -2604,7 +2604,7 @@ public:
|
|||||||
mutable ReadStatement<3> selectAllSourcesStatement{
|
mutable ReadStatement<3> selectAllSourcesStatement{
|
||||||
"SELECT sourceName, sourceContextId, sourceId FROM sources", database};
|
"SELECT sourceName, sourceContextId, sourceId FROM sources", database};
|
||||||
mutable ReadStatement<6, 1> selectTypeByTypeIdStatement{
|
mutable ReadStatement<6, 1> selectTypeByTypeIdStatement{
|
||||||
"SELECT sourceId, t.name, t.typeId, prototypeId, accessSemantics, pd.name "
|
"SELECT sourceId, t.name, t.typeId, prototypeId, traits, pd.name "
|
||||||
"FROM types AS t LEFT JOIN propertyDeclarations AS pd "
|
"FROM types AS t LEFT JOIN propertyDeclarations AS pd "
|
||||||
" ON defaultPropertyId=propertyDeclarationId WHERE t.typeId=?",
|
" ON defaultPropertyId=propertyDeclarationId WHERE t.typeId=?",
|
||||||
database};
|
database};
|
||||||
@@ -2613,7 +2613,7 @@ public:
|
|||||||
"exportedTypeNames WHERE typeId=?",
|
"exportedTypeNames WHERE typeId=?",
|
||||||
database};
|
database};
|
||||||
mutable ReadStatement<6> selectTypesStatement{
|
mutable ReadStatement<6> selectTypesStatement{
|
||||||
"SELECT sourceId, t.name, t.typeId, prototypeId, accessSemantics, pd.name "
|
"SELECT sourceId, t.name, t.typeId, prototypeId, traits, pd.name "
|
||||||
"FROM types AS t LEFT JOIN propertyDeclarations AS pd "
|
"FROM types AS t LEFT JOIN propertyDeclarations AS pd "
|
||||||
" ON defaultPropertyId=propertyDeclarationId",
|
" ON defaultPropertyId=propertyDeclarationId",
|
||||||
database};
|
database};
|
||||||
|
@@ -43,6 +43,7 @@ constexpr std::underlying_type_t<Enumeration> to_underlying(Enumeration enumerat
|
|||||||
return static_cast<std::underlying_type_t<Enumeration>>(enumeration);
|
return static_cast<std::underlying_type_t<Enumeration>>(enumeration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
|
||||||
namespace QmlDesigner::Storage {
|
namespace QmlDesigner::Storage {
|
||||||
@@ -63,19 +64,26 @@ constexpr bool operator&(PropertyDeclarationTraits first, PropertyDeclarationTra
|
|||||||
return static_cast<int>(first) & static_cast<int>(second);
|
return static_cast<int>(first) & static_cast<int>(second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum class TypeTraits : int {
|
||||||
|
None,
|
||||||
|
Reference,
|
||||||
|
Value,
|
||||||
|
Sequence,
|
||||||
|
IsEnum = 1 << 8,
|
||||||
|
IsFileComponent = 1 << 9
|
||||||
|
};
|
||||||
|
|
||||||
|
constexpr TypeTraits operator|(TypeTraits first, TypeTraits second)
|
||||||
|
{
|
||||||
|
return static_cast<TypeTraits>(static_cast<int>(first) | static_cast<int>(second));
|
||||||
|
}
|
||||||
|
|
||||||
using TypeNameString = Utils::BasicSmallString<63>;
|
using TypeNameString = Utils::BasicSmallString<63>;
|
||||||
|
|
||||||
} // namespace QmlDesigner::Storage
|
} // namespace QmlDesigner::Storage
|
||||||
|
|
||||||
namespace QmlDesigner::Storage::Synchronization {
|
namespace QmlDesigner::Storage::Synchronization {
|
||||||
|
|
||||||
enum class TypeAccessSemantics : int { None, Reference, Value, Sequence, IsEnum = 1 << 8 };
|
|
||||||
|
|
||||||
constexpr TypeAccessSemantics operator|(TypeAccessSemantics first, TypeAccessSemantics second)
|
|
||||||
{
|
|
||||||
return static_cast<TypeAccessSemantics>(static_cast<int>(first) | static_cast<int>(second));
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class TypeNameKind { Exported = 1, QualifiedExported = 2 };
|
enum class TypeNameKind { Exported = 1, QualifiedExported = 2 };
|
||||||
|
|
||||||
enum class FileType : char { QmlTypes, QmlDocument };
|
enum class FileType : char { QmlTypes, QmlDocument };
|
||||||
@@ -728,7 +736,7 @@ public:
|
|||||||
explicit Type() = default;
|
explicit Type() = default;
|
||||||
explicit Type(Utils::SmallStringView typeName,
|
explicit Type(Utils::SmallStringView typeName,
|
||||||
ImportedTypeName prototype,
|
ImportedTypeName prototype,
|
||||||
TypeAccessSemantics accessSemantics,
|
TypeTraits traits,
|
||||||
SourceId sourceId,
|
SourceId sourceId,
|
||||||
ExportedTypes exportedTypes = {},
|
ExportedTypes exportedTypes = {},
|
||||||
PropertyDeclarations propertyDeclarations = {},
|
PropertyDeclarations propertyDeclarations = {},
|
||||||
@@ -745,40 +753,37 @@ public:
|
|||||||
, functionDeclarations{std::move(functionDeclarations)}
|
, functionDeclarations{std::move(functionDeclarations)}
|
||||||
, signalDeclarations{std::move(signalDeclarations)}
|
, signalDeclarations{std::move(signalDeclarations)}
|
||||||
, enumerationDeclarations{std::move(enumerationDeclarations)}
|
, enumerationDeclarations{std::move(enumerationDeclarations)}
|
||||||
, accessSemantics{accessSemantics}
|
, traits{traits}
|
||||||
, sourceId{sourceId}
|
, sourceId{sourceId}
|
||||||
, changeLevel{changeLevel}
|
, changeLevel{changeLevel}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
explicit Type(Utils::SmallStringView typeName,
|
explicit Type(Utils::SmallStringView typeName, TypeId prototypeId, TypeTraits traits, SourceId sourceId)
|
||||||
TypeId prototypeId,
|
|
||||||
TypeAccessSemantics accessSemantics,
|
|
||||||
SourceId sourceId)
|
|
||||||
: typeName{typeName}
|
: typeName{typeName}
|
||||||
, accessSemantics{accessSemantics}
|
, traits{traits}
|
||||||
, sourceId{sourceId}
|
, sourceId{sourceId}
|
||||||
, prototypeId{prototypeId}
|
, prototypeId{prototypeId}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
explicit Type(Utils::SmallStringView typeName,
|
explicit Type(Utils::SmallStringView typeName,
|
||||||
ImportedTypeName prototype,
|
ImportedTypeName prototype,
|
||||||
TypeAccessSemantics accessSemantics,
|
TypeTraits traits,
|
||||||
SourceId sourceId,
|
SourceId sourceId,
|
||||||
ChangeLevel changeLevel)
|
ChangeLevel changeLevel)
|
||||||
: typeName{typeName}
|
: typeName{typeName}
|
||||||
, prototype{std::move(prototype)}
|
, prototype{std::move(prototype)}
|
||||||
, accessSemantics{accessSemantics}
|
, traits{traits}
|
||||||
, sourceId{sourceId}
|
, sourceId{sourceId}
|
||||||
, changeLevel{changeLevel}
|
, changeLevel{changeLevel}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
explicit Type(Utils::SmallStringView typeName,
|
explicit Type(Utils::SmallStringView typeName,
|
||||||
Utils::SmallStringView prototype,
|
Utils::SmallStringView prototype,
|
||||||
TypeAccessSemantics accessSemantics,
|
TypeTraits traits,
|
||||||
SourceId sourceId)
|
SourceId sourceId)
|
||||||
: typeName{typeName}
|
: typeName{typeName}
|
||||||
, prototype{ImportedType{prototype}}
|
, prototype{ImportedType{prototype}}
|
||||||
, accessSemantics{accessSemantics}
|
, traits{traits}
|
||||||
, sourceId{sourceId}
|
, sourceId{sourceId}
|
||||||
|
|
||||||
{}
|
{}
|
||||||
@@ -787,11 +792,11 @@ public:
|
|||||||
Utils::SmallStringView typeName,
|
Utils::SmallStringView typeName,
|
||||||
TypeId typeId,
|
TypeId typeId,
|
||||||
TypeId prototypeId,
|
TypeId prototypeId,
|
||||||
TypeAccessSemantics accessSemantics,
|
TypeTraits traits,
|
||||||
Utils::SmallStringView defaultPropertyName)
|
Utils::SmallStringView defaultPropertyName)
|
||||||
: typeName{typeName}
|
: typeName{typeName}
|
||||||
, defaultPropertyName{defaultPropertyName}
|
, defaultPropertyName{defaultPropertyName}
|
||||||
, accessSemantics{accessSemantics}
|
, traits{traits}
|
||||||
, sourceId{sourceId}
|
, sourceId{sourceId}
|
||||||
, typeId{typeId}
|
, typeId{typeId}
|
||||||
, prototypeId{prototypeId}
|
, prototypeId{prototypeId}
|
||||||
@@ -817,7 +822,7 @@ public:
|
|||||||
FunctionDeclarations functionDeclarations;
|
FunctionDeclarations functionDeclarations;
|
||||||
SignalDeclarations signalDeclarations;
|
SignalDeclarations signalDeclarations;
|
||||||
EnumerationDeclarations enumerationDeclarations;
|
EnumerationDeclarations enumerationDeclarations;
|
||||||
TypeAccessSemantics accessSemantics = TypeAccessSemantics::None;
|
TypeTraits traits = TypeTraits::None;
|
||||||
SourceId sourceId;
|
SourceId sourceId;
|
||||||
TypeId typeId;
|
TypeId typeId;
|
||||||
TypeId prototypeId;
|
TypeId prototypeId;
|
||||||
|
@@ -416,7 +416,7 @@ void ProjectStorageUpdater::parseQmlComponent(Utils::SmallStringView relativeFil
|
|||||||
package.updatedSourceIds.push_back(sourceId);
|
package.updatedSourceIds.push_back(sourceId);
|
||||||
|
|
||||||
type.typeName = SourcePath{qmlFilePath}.name();
|
type.typeName = SourcePath{qmlFilePath}.name();
|
||||||
type.accessSemantics = Storage::Synchronization::TypeAccessSemantics::Reference;
|
type.traits = Storage::TypeTraits::Reference;
|
||||||
type.sourceId = sourceId;
|
type.sourceId = sourceId;
|
||||||
type.exportedTypes = std::move(exportedTypes);
|
type.exportedTypes = std::move(exportedTypes);
|
||||||
|
|
||||||
@@ -445,7 +445,7 @@ void ProjectStorageUpdater::parseQmlComponent(Utils::SmallStringView fileName,
|
|||||||
auto type = m_qmlDocumentParser.parse(content, package.imports, sourceId, directoryPath);
|
auto type = m_qmlDocumentParser.parse(content, package.imports, sourceId, directoryPath);
|
||||||
|
|
||||||
type.typeName = fileName;
|
type.typeName = fileName;
|
||||||
type.accessSemantics = Storage::Synchronization::TypeAccessSemantics::Reference;
|
type.traits = Storage::TypeTraits::Reference;
|
||||||
type.sourceId = sourceId;
|
type.sourceId = sourceId;
|
||||||
type.changeLevel = Storage::Synchronization::ChangeLevel::ExcludeExportedTypes;
|
type.changeLevel = Storage::Synchronization::ChangeLevel::ExcludeExportedTypes;
|
||||||
|
|
||||||
|
@@ -101,21 +101,21 @@ void addImports(Storage::Synchronization::Imports &imports,
|
|||||||
imports.emplace_back(qmlCppModuleId, Storage::Synchronization::Version{}, sourceId);
|
imports.emplace_back(qmlCppModuleId, Storage::Synchronization::Version{}, sourceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
Storage::Synchronization::TypeAccessSemantics createTypeAccessSemantics(
|
Storage::Synchronization::TypeTraits createTypeTraits(
|
||||||
QQmlJSScope::AccessSemantics accessSematics)
|
QQmlJSScope::AccessSemantics accessSematics)
|
||||||
{
|
{
|
||||||
switch (accessSematics) {
|
switch (accessSematics) {
|
||||||
case QQmlJSScope::AccessSemantics::Reference:
|
case QQmlJSScope::AccessSemantics::Reference:
|
||||||
return Storage::Synchronization::TypeAccessSemantics::Reference;
|
return Storage::Synchronization::TypeTraits::Reference;
|
||||||
case QQmlJSScope::AccessSemantics::Value:
|
case QQmlJSScope::AccessSemantics::Value:
|
||||||
return Storage::Synchronization::TypeAccessSemantics::Value;
|
return Storage::Synchronization::TypeTraits::Value;
|
||||||
case QQmlJSScope::AccessSemantics::None:
|
case QQmlJSScope::AccessSemantics::None:
|
||||||
return Storage::Synchronization::TypeAccessSemantics::None;
|
return Storage::Synchronization::TypeTraits::None;
|
||||||
case QQmlJSScope::AccessSemantics::Sequence:
|
case QQmlJSScope::AccessSemantics::Sequence:
|
||||||
return Storage::Synchronization::TypeAccessSemantics::Sequence;
|
return Storage::Synchronization::TypeTraits::Sequence;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Storage::Synchronization::TypeAccessSemantics::None;
|
return Storage::Synchronization::TypeTraits::None;
|
||||||
}
|
}
|
||||||
|
|
||||||
Storage::Synchronization::Version createVersion(QTypeRevision qmlVersion)
|
Storage::Synchronization::Version createVersion(QTypeRevision qmlVersion)
|
||||||
@@ -369,8 +369,8 @@ void addEnumerationType(EnumerationTypes &enumerationTypes,
|
|||||||
auto fullTypeName = addEnumerationType(enumerationTypes, typeName, enumerationName);
|
auto fullTypeName = addEnumerationType(enumerationTypes, typeName, enumerationName);
|
||||||
types.emplace_back(fullTypeName,
|
types.emplace_back(fullTypeName,
|
||||||
Storage::Synchronization::ImportedType{TypeNameString{}},
|
Storage::Synchronization::ImportedType{TypeNameString{}},
|
||||||
Storage::Synchronization::TypeAccessSemantics::Value
|
Storage::Synchronization::TypeTraits::Value
|
||||||
| Storage::Synchronization::TypeAccessSemantics::IsEnum,
|
| Storage::Synchronization::TypeTraits::IsEnum,
|
||||||
sourceId,
|
sourceId,
|
||||||
createCppEnumerationExports(typeName,
|
createCppEnumerationExports(typeName,
|
||||||
cppModuleId,
|
cppModuleId,
|
||||||
@@ -440,7 +440,7 @@ void addType(Storage::Synchronization::Types &types,
|
|||||||
auto enumerationTypes = addEnumerationTypes(types, typeName, sourceId, cppModuleId, enumerations);
|
auto enumerationTypes = addEnumerationTypes(types, typeName, sourceId, cppModuleId, enumerations);
|
||||||
types.emplace_back(Utils::SmallStringView{typeName},
|
types.emplace_back(Utils::SmallStringView{typeName},
|
||||||
Storage::Synchronization::ImportedType{TypeNameString{component.baseTypeName()}},
|
Storage::Synchronization::ImportedType{TypeNameString{component.baseTypeName()}},
|
||||||
createTypeAccessSemantics(component.accessSemantics()),
|
createTypeTraits(component.traits()),
|
||||||
sourceId,
|
sourceId,
|
||||||
createExports(exports, typeName, storage, cppModuleId),
|
createExports(exports, typeName, storage, cppModuleId),
|
||||||
createProperties(component.ownProperties(),
|
createProperties(component.ownProperties(),
|
||||||
|
@@ -473,6 +473,7 @@ const char *sourceTypeToText(SourceType sourceType)
|
|||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, const FileStatus &fileStatus)
|
std::ostream &operator<<(std::ostream &out, const FileStatus &fileStatus)
|
||||||
@@ -517,6 +518,7 @@ std::ostream &operator<<(std::ostream &out, const VariantProperty &property)
|
|||||||
return out << "(" << property.parentModelNode() << ", " << property.name() << ", "
|
return out << "(" << property.parentModelNode() << ", " << property.name() << ", "
|
||||||
<< property.value() << ")";
|
<< property.value() << ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Cache {
|
namespace Cache {
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, const SourceContext &sourceContext)
|
std::ostream &operator<<(std::ostream &out, const SourceContext &sourceContext)
|
||||||
@@ -526,6 +528,53 @@ std::ostream &operator<<(std::ostream &out, const SourceContext &sourceContext)
|
|||||||
} // namespace Cache
|
} // namespace Cache
|
||||||
|
|
||||||
namespace Storage {
|
namespace Storage {
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
TypeTraits cleanFlags(TypeTraits traits)
|
||||||
|
{
|
||||||
|
auto data = static_cast<int>(traits);
|
||||||
|
data &= ~static_cast<int>(TypeTraits::IsEnum);
|
||||||
|
return static_cast<TypeTraits>(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *typeTraitsToString(TypeTraits traits)
|
||||||
|
{
|
||||||
|
switch (cleanFlags(traits)) {
|
||||||
|
case TypeTraits::None:
|
||||||
|
return "None";
|
||||||
|
case TypeTraits::Reference:
|
||||||
|
return "Reference";
|
||||||
|
case TypeTraits::Sequence:
|
||||||
|
return "Sequence";
|
||||||
|
case TypeTraits::Value:
|
||||||
|
return "Value";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator&(TypeTraits first, TypeTraits second)
|
||||||
|
{
|
||||||
|
return static_cast<int>(first) & static_cast<int>(second);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *typeTraitsFlagsToString(TypeTraits traits)
|
||||||
|
{
|
||||||
|
if (traits & TypeTraits::IsEnum)
|
||||||
|
return "(IsEnum)";
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
std::ostream &operator<<(std::ostream &out, TypeTraits traits)
|
||||||
|
{
|
||||||
|
return out << typeTraitsToString(traits) << typeTraitsFlagsToString(traits);
|
||||||
|
}
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, PropertyDeclarationTraits traits)
|
std::ostream &operator<<(std::ostream &out, PropertyDeclarationTraits traits)
|
||||||
{
|
{
|
||||||
const char *padding = "";
|
const char *padding = "";
|
||||||
@@ -567,44 +616,6 @@ namespace Storage::Synchronization {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
TypeAccessSemantics cleanFlags(TypeAccessSemantics accessSemantics)
|
|
||||||
{
|
|
||||||
auto data = static_cast<int>(accessSemantics);
|
|
||||||
data &= ~static_cast<int>(TypeAccessSemantics::IsEnum);
|
|
||||||
return static_cast<TypeAccessSemantics>(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *typeAccessSemanticsToString(TypeAccessSemantics accessSemantics)
|
|
||||||
{
|
|
||||||
switch (cleanFlags(accessSemantics)) {
|
|
||||||
case TypeAccessSemantics::None:
|
|
||||||
return "None";
|
|
||||||
case TypeAccessSemantics::Reference:
|
|
||||||
return "Reference";
|
|
||||||
case TypeAccessSemantics::Sequence:
|
|
||||||
return "Sequence";
|
|
||||||
case TypeAccessSemantics::Value:
|
|
||||||
return "Value";
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator&(TypeAccessSemantics first, TypeAccessSemantics second)
|
|
||||||
{
|
|
||||||
return static_cast<int>(first) & static_cast<int>(second);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *typeAccessSemanticsFlagsToString(TypeAccessSemantics accessSemantics)
|
|
||||||
{
|
|
||||||
if (accessSemantics & TypeAccessSemantics::IsEnum)
|
|
||||||
return "(IsEnum)";
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *isQualifiedToString(IsQualified isQualified)
|
const char *isQualifiedToString(IsQualified isQualified)
|
||||||
{
|
{
|
||||||
switch (isQualified) {
|
switch (isQualified) {
|
||||||
@@ -696,12 +707,6 @@ std::ostream &operator<<(std::ostream &out, const ProjectData &data)
|
|||||||
<< ", " << data.fileType << ")";
|
<< ", " << data.fileType << ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, TypeAccessSemantics accessSemantics)
|
|
||||||
{
|
|
||||||
return out << typeAccessSemanticsToString(accessSemantics)
|
|
||||||
<< typeAccessSemanticsFlagsToString(accessSemantics);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, IsQualified isQualified)
|
std::ostream &operator<<(std::ostream &out, IsQualified isQualified)
|
||||||
{
|
{
|
||||||
return out << isQualifiedToString(isQualified);
|
return out << isQualifiedToString(isQualified);
|
||||||
@@ -736,7 +741,7 @@ std::ostream &operator<<(std::ostream &out, const Type &type)
|
|||||||
{
|
{
|
||||||
using Utils::operator<<;
|
using Utils::operator<<;
|
||||||
return out << "( typename: \"" << type.typeName << "\", prototype: " << type.prototype << ", "
|
return out << "( typename: \"" << type.typeName << "\", prototype: " << type.prototype << ", "
|
||||||
<< type.prototypeId << ", " << type.accessSemantics << ", source: " << type.sourceId
|
<< type.prototypeId << ", " << type.traits << ", source: " << type.sourceId
|
||||||
<< ", exports: " << type.exportedTypes << ", properties: " << type.propertyDeclarations
|
<< ", exports: " << type.exportedTypes << ", properties: " << type.propertyDeclarations
|
||||||
<< ", functions: " << type.functionDeclarations
|
<< ", functions: " << type.functionDeclarations
|
||||||
<< ", signals: " << type.signalDeclarations << ", changeLevel: " << type.changeLevel
|
<< ", signals: " << type.signalDeclarations << ", changeLevel: " << type.changeLevel
|
||||||
|
@@ -140,8 +140,6 @@ class FileStatus;
|
|||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, const ModelNode &node);
|
std::ostream &operator<<(std::ostream &out, const ModelNode &node);
|
||||||
std::ostream &operator<<(std::ostream &out, const VariantProperty &property);
|
std::ostream &operator<<(std::ostream &out, const VariantProperty &property);
|
||||||
|
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, const WatcherEntry &entry);
|
std::ostream &operator<<(std::ostream &out, const WatcherEntry &entry);
|
||||||
std::ostream &operator<<(std::ostream &out, const IdPaths &idPaths);
|
std::ostream &operator<<(std::ostream &out, const IdPaths &idPaths);
|
||||||
std::ostream &operator<<(std::ostream &out, const ProjectChunkId &id);
|
std::ostream &operator<<(std::ostream &out, const ProjectChunkId &id);
|
||||||
@@ -156,8 +154,11 @@ std::ostream &operator<<(std::ostream &out, const SourceContext &sourceContext);
|
|||||||
|
|
||||||
namespace Storage {
|
namespace Storage {
|
||||||
enum class PropertyDeclarationTraits : int;
|
enum class PropertyDeclarationTraits : int;
|
||||||
|
enum class TypeTraits : int;
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, PropertyDeclarationTraits traits);
|
std::ostream &operator<<(std::ostream &out, PropertyDeclarationTraits traits);
|
||||||
|
std::ostream &operator<<(std::ostream &out, TypeTraits traits);
|
||||||
|
|
||||||
} // namespace Storage
|
} // namespace Storage
|
||||||
|
|
||||||
namespace Storage::Info {
|
namespace Storage::Info {
|
||||||
@@ -176,7 +177,6 @@ class ImportedType;
|
|||||||
class QualifiedImportedType;
|
class QualifiedImportedType;
|
||||||
class Version;
|
class Version;
|
||||||
class VersionNumber;
|
class VersionNumber;
|
||||||
enum class TypeAccessSemantics : int;
|
|
||||||
class PropertyDeclaration;
|
class PropertyDeclaration;
|
||||||
class FunctionDeclaration;
|
class FunctionDeclaration;
|
||||||
class ParameterDeclaration;
|
class ParameterDeclaration;
|
||||||
@@ -193,7 +193,6 @@ enum class FileType : char;
|
|||||||
enum class ChangeLevel : char;
|
enum class ChangeLevel : char;
|
||||||
class ModuleExportedImport;
|
class ModuleExportedImport;
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &out, TypeAccessSemantics accessSemantics);
|
|
||||||
std::ostream &operator<<(std::ostream &out, VersionNumber versionNumber);
|
std::ostream &operator<<(std::ostream &out, VersionNumber versionNumber);
|
||||||
std::ostream &operator<<(std::ostream &out, Version version);
|
std::ostream &operator<<(std::ostream &out, Version version);
|
||||||
std::ostream &operator<<(std::ostream &out, const Type &type);
|
std::ostream &operator<<(std::ostream &out, const Type &type);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -43,9 +43,9 @@ namespace Storage = QmlDesigner::Storage;
|
|||||||
using QmlDesigner::FileStatus;
|
using QmlDesigner::FileStatus;
|
||||||
using QmlDesigner::ModuleId;
|
using QmlDesigner::ModuleId;
|
||||||
using QmlDesigner::SourceId;
|
using QmlDesigner::SourceId;
|
||||||
using QmlDesigner::Storage::Synchronization::TypeAccessSemantics;
|
|
||||||
namespace Storage = QmlDesigner::Storage;
|
namespace Storage = QmlDesigner::Storage;
|
||||||
using QmlDesigner::IdPaths;
|
using QmlDesigner::IdPaths;
|
||||||
|
using QmlDesigner::Storage::TypeTraits;
|
||||||
using QmlDesigner::Storage::Synchronization::FileType;
|
using QmlDesigner::Storage::Synchronization::FileType;
|
||||||
using QmlDesigner::Storage::Synchronization::Import;
|
using QmlDesigner::Storage::Synchronization::Import;
|
||||||
using QmlDesigner::Storage::Synchronization::IsAutoVersion;
|
using QmlDesigner::Storage::Synchronization::IsAutoVersion;
|
||||||
@@ -57,17 +57,16 @@ using QmlDesigner::Storage::Synchronization::Version;
|
|||||||
MATCHER_P5(IsStorageType,
|
MATCHER_P5(IsStorageType,
|
||||||
typeName,
|
typeName,
|
||||||
prototype,
|
prototype,
|
||||||
accessSemantics,
|
traits,
|
||||||
sourceId,
|
sourceId,
|
||||||
changeLevel,
|
changeLevel,
|
||||||
std::string(negation ? "isn't " : "is ")
|
std::string(negation ? "isn't " : "is ")
|
||||||
+ PrintToString(Storage::Synchronization::Type(
|
+ PrintToString(Storage::Synchronization::Type(
|
||||||
typeName, prototype, accessSemantics, sourceId, changeLevel)))
|
typeName, prototype, traits, sourceId, changeLevel)))
|
||||||
{
|
{
|
||||||
const Storage::Synchronization::Type &type = arg;
|
const Storage::Synchronization::Type &type = arg;
|
||||||
|
|
||||||
return type.typeName == typeName && type.accessSemantics == accessSemantics
|
return type.typeName == typeName && type.traits == traits && type.sourceId == sourceId
|
||||||
&& type.sourceId == sourceId
|
|
||||||
&& Storage::Synchronization::ImportedTypeName{prototype} == type.prototype
|
&& Storage::Synchronization::ImportedTypeName{prototype} == type.prototype
|
||||||
&& type.changeLevel == changeLevel;
|
&& type.changeLevel == changeLevel;
|
||||||
}
|
}
|
||||||
@@ -257,13 +256,13 @@ protected:
|
|||||||
Storage::Synchronization::Type objectType{
|
Storage::Synchronization::Type objectType{
|
||||||
"QObject",
|
"QObject",
|
||||||
Storage::Synchronization::ImportedType{},
|
Storage::Synchronization::ImportedType{},
|
||||||
Storage::Synchronization::TypeAccessSemantics::Reference,
|
Storage::TypeTraits::Reference,
|
||||||
qmltypesPathSourceId,
|
qmltypesPathSourceId,
|
||||||
{Storage::Synchronization::ExportedType{exampleModuleId, "Object"},
|
{Storage::Synchronization::ExportedType{exampleModuleId, "Object"},
|
||||||
Storage::Synchronization::ExportedType{exampleModuleId, "Obj"}}};
|
Storage::Synchronization::ExportedType{exampleModuleId, "Obj"}}};
|
||||||
Storage::Synchronization::Type itemType{"QItem",
|
Storage::Synchronization::Type itemType{"QItem",
|
||||||
Storage::Synchronization::ImportedType{},
|
Storage::Synchronization::ImportedType{},
|
||||||
Storage::Synchronization::TypeAccessSemantics::Reference,
|
Storage::TypeTraits::Reference,
|
||||||
qmltypes2PathSourceId,
|
qmltypes2PathSourceId,
|
||||||
{Storage::Synchronization::ExportedType{exampleModuleId,
|
{Storage::Synchronization::ExportedType{exampleModuleId,
|
||||||
"Item"}}};
|
"Item"}}};
|
||||||
@@ -526,7 +525,7 @@ TEST_F(ProjectStorageUpdater, SynchronizeQmlDocuments)
|
|||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
AllOf(IsStorageType("First.qml",
|
AllOf(IsStorageType("First.qml",
|
||||||
Storage::Synchronization::ImportedType{"Object"},
|
Storage::Synchronization::ImportedType{"Object"},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId1,
|
qmlDocumentSourceId1,
|
||||||
Storage::Synchronization::ChangeLevel::Full),
|
Storage::Synchronization::ChangeLevel::Full),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes,
|
Field(&Storage::Synchronization::Type::exportedTypes,
|
||||||
@@ -534,7 +533,7 @@ TEST_F(ProjectStorageUpdater, SynchronizeQmlDocuments)
|
|||||||
IsExportedType(pathModuleId, "First", -1, -1)))),
|
IsExportedType(pathModuleId, "First", -1, -1)))),
|
||||||
AllOf(IsStorageType("First2.qml",
|
AllOf(IsStorageType("First2.qml",
|
||||||
Storage::Synchronization::ImportedType{"Object2"},
|
Storage::Synchronization::ImportedType{"Object2"},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId2,
|
qmlDocumentSourceId2,
|
||||||
Storage::Synchronization::ChangeLevel::Full),
|
Storage::Synchronization::ChangeLevel::Full),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes,
|
Field(&Storage::Synchronization::Type::exportedTypes,
|
||||||
@@ -542,7 +541,7 @@ TEST_F(ProjectStorageUpdater, SynchronizeQmlDocuments)
|
|||||||
IsExportedType(pathModuleId, "First2", -1, -1)))),
|
IsExportedType(pathModuleId, "First2", -1, -1)))),
|
||||||
AllOf(IsStorageType("Second.qml",
|
AllOf(IsStorageType("Second.qml",
|
||||||
Storage::Synchronization::ImportedType{"Object3"},
|
Storage::Synchronization::ImportedType{"Object3"},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId3,
|
qmlDocumentSourceId3,
|
||||||
Storage::Synchronization::ChangeLevel::Full),
|
Storage::Synchronization::ChangeLevel::Full),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes,
|
Field(&Storage::Synchronization::Type::exportedTypes,
|
||||||
@@ -612,7 +611,7 @@ TEST_F(ProjectStorageUpdater, SynchronizeRemoved)
|
|||||||
Eq(objectType),
|
Eq(objectType),
|
||||||
AllOf(IsStorageType("First.qml",
|
AllOf(IsStorageType("First.qml",
|
||||||
Storage::Synchronization::ImportedType{"Object"},
|
Storage::Synchronization::ImportedType{"Object"},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId1,
|
qmlDocumentSourceId1,
|
||||||
Storage::Synchronization::ChangeLevel::Full),
|
Storage::Synchronization::ChangeLevel::Full),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes,
|
Field(&Storage::Synchronization::Type::exportedTypes,
|
||||||
@@ -620,7 +619,7 @@ TEST_F(ProjectStorageUpdater, SynchronizeRemoved)
|
|||||||
IsExportedType(pathModuleId, "First", -1, -1)))),
|
IsExportedType(pathModuleId, "First", -1, -1)))),
|
||||||
AllOf(IsStorageType("First2.qml",
|
AllOf(IsStorageType("First2.qml",
|
||||||
Storage::Synchronization::ImportedType{},
|
Storage::Synchronization::ImportedType{},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId2,
|
qmlDocumentSourceId2,
|
||||||
Storage::Synchronization::ChangeLevel::Minimal),
|
Storage::Synchronization::ChangeLevel::Minimal),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes,
|
Field(&Storage::Synchronization::Type::exportedTypes,
|
||||||
@@ -682,7 +681,7 @@ TEST_F(ProjectStorageUpdater, SynchronizeQmlDocumentsDontUpdateIfUpToDate)
|
|||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
AllOf(IsStorageType("First.qml",
|
AllOf(IsStorageType("First.qml",
|
||||||
Storage::Synchronization::ImportedType{"Object"},
|
Storage::Synchronization::ImportedType{"Object"},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId1,
|
qmlDocumentSourceId1,
|
||||||
Storage::Synchronization::ChangeLevel::Full),
|
Storage::Synchronization::ChangeLevel::Full),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes,
|
Field(&Storage::Synchronization::Type::exportedTypes,
|
||||||
@@ -690,7 +689,7 @@ TEST_F(ProjectStorageUpdater, SynchronizeQmlDocumentsDontUpdateIfUpToDate)
|
|||||||
IsExportedType(pathModuleId, "First", -1, -1)))),
|
IsExportedType(pathModuleId, "First", -1, -1)))),
|
||||||
AllOf(IsStorageType("First2.qml",
|
AllOf(IsStorageType("First2.qml",
|
||||||
Storage::Synchronization::ImportedType{"Object2"},
|
Storage::Synchronization::ImportedType{"Object2"},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId2,
|
qmlDocumentSourceId2,
|
||||||
Storage::Synchronization::ChangeLevel::Full),
|
Storage::Synchronization::ChangeLevel::Full),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes,
|
Field(&Storage::Synchronization::Type::exportedTypes,
|
||||||
@@ -698,7 +697,7 @@ TEST_F(ProjectStorageUpdater, SynchronizeQmlDocumentsDontUpdateIfUpToDate)
|
|||||||
IsExportedType(pathModuleId, "First2", -1, -1)))),
|
IsExportedType(pathModuleId, "First2", -1, -1)))),
|
||||||
AllOf(IsStorageType("Second.qml",
|
AllOf(IsStorageType("Second.qml",
|
||||||
Storage::Synchronization::ImportedType{},
|
Storage::Synchronization::ImportedType{},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId3,
|
qmlDocumentSourceId3,
|
||||||
Storage::Synchronization::ChangeLevel::Minimal),
|
Storage::Synchronization::ChangeLevel::Minimal),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes,
|
Field(&Storage::Synchronization::Type::exportedTypes,
|
||||||
@@ -790,13 +789,13 @@ TEST_F(ProjectStorageUpdater, SynchronizIfQmldirFileHasNotChanged)
|
|||||||
Eq(itemType),
|
Eq(itemType),
|
||||||
AllOf(IsStorageType("First.qml",
|
AllOf(IsStorageType("First.qml",
|
||||||
Storage::Synchronization::ImportedType{"Object"},
|
Storage::Synchronization::ImportedType{"Object"},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId1,
|
qmlDocumentSourceId1,
|
||||||
Storage::Synchronization::ChangeLevel::ExcludeExportedTypes),
|
Storage::Synchronization::ChangeLevel::ExcludeExportedTypes),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes, IsEmpty())),
|
Field(&Storage::Synchronization::Type::exportedTypes, IsEmpty())),
|
||||||
AllOf(IsStorageType("First2.qml",
|
AllOf(IsStorageType("First2.qml",
|
||||||
Storage::Synchronization::ImportedType{"Object2"},
|
Storage::Synchronization::ImportedType{"Object2"},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId2,
|
qmlDocumentSourceId2,
|
||||||
Storage::Synchronization::ChangeLevel::ExcludeExportedTypes),
|
Storage::Synchronization::ChangeLevel::ExcludeExportedTypes),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes, IsEmpty())))),
|
Field(&Storage::Synchronization::Type::exportedTypes, IsEmpty())))),
|
||||||
@@ -844,7 +843,7 @@ TEST_F(ProjectStorageUpdater, SynchronizIfQmldirFileHasNotChangedAndSomeUpdatedF
|
|||||||
Eq(objectType),
|
Eq(objectType),
|
||||||
AllOf(IsStorageType("First.qml",
|
AllOf(IsStorageType("First.qml",
|
||||||
Storage::Synchronization::ImportedType{"Object"},
|
Storage::Synchronization::ImportedType{"Object"},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId1,
|
qmlDocumentSourceId1,
|
||||||
Storage::Synchronization::ChangeLevel::ExcludeExportedTypes),
|
Storage::Synchronization::ChangeLevel::ExcludeExportedTypes),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes, IsEmpty())))),
|
Field(&Storage::Synchronization::Type::exportedTypes, IsEmpty())))),
|
||||||
@@ -942,7 +941,7 @@ TEST_F(ProjectStorageUpdater, SynchronizeQmlDocumentsWithDifferentVersionButSame
|
|||||||
UnorderedElementsAre(AllOf(
|
UnorderedElementsAre(AllOf(
|
||||||
IsStorageType("First.qml",
|
IsStorageType("First.qml",
|
||||||
Storage::Synchronization::ImportedType{"Object"},
|
Storage::Synchronization::ImportedType{"Object"},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId1,
|
qmlDocumentSourceId1,
|
||||||
Storage::Synchronization::ChangeLevel::Full),
|
Storage::Synchronization::ChangeLevel::Full),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes,
|
Field(&Storage::Synchronization::Type::exportedTypes,
|
||||||
@@ -983,7 +982,7 @@ TEST_F(ProjectStorageUpdater, SynchronizeQmlDocumentsWithDifferentTypeNameButSam
|
|||||||
UnorderedElementsAre(AllOf(
|
UnorderedElementsAre(AllOf(
|
||||||
IsStorageType("First.qml",
|
IsStorageType("First.qml",
|
||||||
Storage::Synchronization::ImportedType{"Object"},
|
Storage::Synchronization::ImportedType{"Object"},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId1,
|
qmlDocumentSourceId1,
|
||||||
Storage::Synchronization::ChangeLevel::Full),
|
Storage::Synchronization::ChangeLevel::Full),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes,
|
Field(&Storage::Synchronization::Type::exportedTypes,
|
||||||
@@ -1056,7 +1055,7 @@ TEST_F(ProjectStorageUpdater, SynchronizeQmlDocumentsWithRelativeFilePath)
|
|||||||
UnorderedElementsAre(AllOf(
|
UnorderedElementsAre(AllOf(
|
||||||
IsStorageType("First.qml",
|
IsStorageType("First.qml",
|
||||||
Storage::Synchronization::ImportedType{"Object"},
|
Storage::Synchronization::ImportedType{"Object"},
|
||||||
TypeAccessSemantics::Reference,
|
TypeTraits::Reference,
|
||||||
qmlDocumentSourceId,
|
qmlDocumentSourceId,
|
||||||
Storage::Synchronization::ChangeLevel::Full),
|
Storage::Synchronization::ChangeLevel::Full),
|
||||||
Field(&Storage::Synchronization::Type::exportedTypes,
|
Field(&Storage::Synchronization::Type::exportedTypes,
|
||||||
|
@@ -61,15 +61,15 @@ MATCHER_P(HasPrototype, prototype, std::string(negation ? "isn't " : "is ") + Pr
|
|||||||
MATCHER_P4(IsType,
|
MATCHER_P4(IsType,
|
||||||
typeName,
|
typeName,
|
||||||
prototype,
|
prototype,
|
||||||
accessSemantics,
|
traits,
|
||||||
sourceId,
|
sourceId,
|
||||||
std::string(negation ? "isn't " : "is ")
|
std::string(negation ? "isn't " : "is ")
|
||||||
+ PrintToString(Storage::Type{typeName, prototype, accessSemantics, sourceId}))
|
+ PrintToString(Storage::Type{typeName, prototype, traits, sourceId}))
|
||||||
{
|
{
|
||||||
const Storage::Type &type = arg;
|
const Storage::Type &type = arg;
|
||||||
|
|
||||||
return type.typeName == typeName && type.prototype == Storage::ImportedTypeName{prototype}
|
return type.typeName == typeName && type.prototype == Storage::ImportedTypeName{prototype}
|
||||||
&& type.accessSemantics == accessSemantics && type.sourceId == sourceId;
|
&& type.traits == traits && type.sourceId == sourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
MATCHER_P3(IsPropertyDeclaration,
|
MATCHER_P3(IsPropertyDeclaration,
|
||||||
@@ -214,11 +214,11 @@ TEST_F(QmlTypesParser, Types)
|
|||||||
ASSERT_THAT(types,
|
ASSERT_THAT(types,
|
||||||
UnorderedElementsAre(IsType("QObject",
|
UnorderedElementsAre(IsType("QObject",
|
||||||
Storage::ImportedType{},
|
Storage::ImportedType{},
|
||||||
Storage::TypeAccessSemantics::Reference,
|
Storage::TypeTraits::Reference,
|
||||||
qmltypesFileSourceId),
|
qmltypesFileSourceId),
|
||||||
IsType("QQmlComponent",
|
IsType("QQmlComponent",
|
||||||
Storage::ImportedType{"QObject"},
|
Storage::ImportedType{"QObject"},
|
||||||
Storage::TypeAccessSemantics::Reference,
|
Storage::TypeTraits::Reference,
|
||||||
qmltypesFileSourceId)));
|
qmltypesFileSourceId)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -543,7 +543,7 @@ TEST_F(QmlTypesParser, EnumerationIsExportedAsType)
|
|||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
AllOf(IsType("QObject::NamedColorSpace",
|
AllOf(IsType("QObject::NamedColorSpace",
|
||||||
Storage::ImportedType{},
|
Storage::ImportedType{},
|
||||||
Storage::TypeAccessSemantics::Value | Storage::TypeAccessSemantics::IsEnum,
|
Storage::TypeTraits::Value | Storage::TypeTraits::IsEnum,
|
||||||
qmltypesFileSourceId),
|
qmltypesFileSourceId),
|
||||||
Field(&Storage::Type::exportedTypes,
|
Field(&Storage::Type::exportedTypes,
|
||||||
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
||||||
@@ -551,7 +551,7 @@ TEST_F(QmlTypesParser, EnumerationIsExportedAsType)
|
|||||||
Storage::Version{})))),
|
Storage::Version{})))),
|
||||||
AllOf(IsType("QObject::VerticalLayoutDirection",
|
AllOf(IsType("QObject::VerticalLayoutDirection",
|
||||||
Storage::ImportedType{},
|
Storage::ImportedType{},
|
||||||
Storage::TypeAccessSemantics::Value | Storage::TypeAccessSemantics::IsEnum,
|
Storage::TypeTraits::Value | Storage::TypeTraits::IsEnum,
|
||||||
qmltypesFileSourceId),
|
qmltypesFileSourceId),
|
||||||
Field(&Storage::Type::exportedTypes,
|
Field(&Storage::Type::exportedTypes,
|
||||||
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
||||||
@@ -584,7 +584,7 @@ TEST_F(QmlTypesParser, EnumerationIsExportedAsTypeWithAlias)
|
|||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
AllOf(IsType("QObject::NamedColorSpaces",
|
AllOf(IsType("QObject::NamedColorSpaces",
|
||||||
Storage::ImportedType{},
|
Storage::ImportedType{},
|
||||||
Storage::TypeAccessSemantics::Value | Storage::TypeAccessSemantics::IsEnum,
|
Storage::TypeTraits::Value | Storage::TypeTraits::IsEnum,
|
||||||
qmltypesFileSourceId),
|
qmltypesFileSourceId),
|
||||||
Field(&Storage::Type::exportedTypes,
|
Field(&Storage::Type::exportedTypes,
|
||||||
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
||||||
@@ -629,7 +629,7 @@ TEST_F(QmlTypesParser, EnumerationIsExportedAsTypeWithAliasToo)
|
|||||||
UnorderedElementsAre(
|
UnorderedElementsAre(
|
||||||
AllOf(IsType("QObject::NamedColorSpaces",
|
AllOf(IsType("QObject::NamedColorSpaces",
|
||||||
Storage::ImportedType{},
|
Storage::ImportedType{},
|
||||||
Storage::TypeAccessSemantics::Value | Storage::TypeAccessSemantics::IsEnum,
|
Storage::TypeTraits::Value | Storage::TypeTraits::IsEnum,
|
||||||
qmltypesFileSourceId),
|
qmltypesFileSourceId),
|
||||||
Field(&Storage::Type::exportedTypes,
|
Field(&Storage::Type::exportedTypes,
|
||||||
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
UnorderedElementsAre(IsExportedType(qtQmlNativeModuleId,
|
||||||
|
Reference in New Issue
Block a user