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

Method declareMethod

plugins/qmljs/duchain/declarationbuilder.cpp:715–739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713}
714
715void DeclarationBuilder::declareMethod(QmlJS::AST::UiObjectInitializer* node,
716 const RangeInRevision &range,
717 const Identifier &name,
718 bool isSlot,
719 bool isSignal)
720{
721 QString type_name = QmlJS::getQMLAttributeValue(node->members, QStringLiteral("type")).value;
722 QmlJS::FunctionType::Ptr type(new QmlJS::FunctionType);
723
724 if (type_name.isEmpty()) {
725 type->setReturnType(typeFromName(QStringLiteral("void")));
726 } else {
727 type->setReturnType(typeFromName(type_name));
728 }
729
730 {
731 DUChainWriteLocker lock;
732 auto* decl = openDeclaration<ClassFunctionDeclaration>(name, range);
733
734 decl->setIsSlot(isSlot);
735 decl->setIsSignal(isSignal);
736 type->setDeclaration(decl);
737 }
738 openType(type);
739}
740
741void DeclarationBuilder::declareProperty(QmlJS::AST::UiObjectInitializer* node,
742 const RangeInRevision &range,

Callers

nothing calls this directly

Calls 6

getQMLAttributeValueFunction · 0.85
setIsSlotMethod · 0.80
setIsSignalMethod · 0.80
isEmptyMethod · 0.45
setReturnTypeMethod · 0.45
setDeclarationMethod · 0.45

Tested by

no test coverage detected