MCPcopy Create free account
hub / github.com/KDE/kdevelop / declareEnum

Method declareEnum

plugins/qmljs/duchain/declarationbuilder.cpp:773–789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

771}
772
773void DeclarationBuilder::declareEnum(const RangeInRevision &range,
774 const Identifier &name)
775{
776 EnumerationType::Ptr type(new EnumerationType);
777
778 {
779 DUChainWriteLocker lock;
780 auto* decl = openDeclaration<ClassMemberDeclaration>(name, range);
781
782 decl->setKind(Declaration::Type);
783 decl->setType(type); // The type needs to be set here because closeContext is called before closeAndAssignType and needs to know the type of decl
784
785 type->setDataType(IntegralType::TypeEnumeration);
786 type->setDeclaration(decl);
787 }
788 openType(type);
789}
790
791void DeclarationBuilder::declareComponentSubclass(QmlJS::AST::UiObjectInitializer* node,
792 const KDevelop::RangeInRevision& range,

Callers

nothing calls this directly

Calls 4

setDataTypeMethod · 0.80
setKindMethod · 0.45
setTypeMethod · 0.45
setDeclarationMethod · 0.45

Tested by

no test coverage detected