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

Method declareComponent

plugins/qmljs/duchain/declarationbuilder.cpp:687–713  ·  view source on GitHub ↗

* plugins.qmltypes files */

Source from the content-addressed store, hash-verified

685 * plugins.qmltypes files
686 */
687void DeclarationBuilder::declareComponent(QmlJS::AST::UiObjectInitializer* node,
688 const RangeInRevision &range,
689 const Identifier &name)
690{
691 QString baseClass = QmlJS::getQMLAttributeValue(node->members, QStringLiteral("prototype")).value.section(QLatin1Char('/'), -1, -1);
692
693 // Declare the component itself
694 StructureType::Ptr type(new StructureType);
695
696 ClassDeclaration* decl;
697 {
698 DUChainWriteLocker lock;
699 decl = openDeclaration<ClassDeclaration>(name, range);
700
701 decl->setKind(Declaration::Type);
702 decl->setClassType(ClassDeclarationData::Interface);
703 decl->clearBaseClasses();
704
705 if (!baseClass.isEmpty()) {
706 addBaseClass(decl, baseClass);
707 }
708
709 type->setDeclaration(decl);
710 decl->setType(type); // declareExports needs to know the type of decl
711 }
712 openType(type);
713}
714
715void DeclarationBuilder::declareMethod(QmlJS::AST::UiObjectInitializer* node,
716 const RangeInRevision &range,

Callers

nothing calls this directly

Calls 8

getQMLAttributeValueFunction · 0.85
sectionMethod · 0.80
setClassTypeMethod · 0.80
clearBaseClassesMethod · 0.80
setKindMethod · 0.45
isEmptyMethod · 0.45
setDeclarationMethod · 0.45
setTypeMethod · 0.45

Tested by

no test coverage detected