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

Method declareParameters

plugins/qmljs/duchain/declarationbuilder.cpp:190–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188
189template<typename Node>
190void DeclarationBuilder::declareParameters(Node* node, QmlJS::AST::UiQualifiedId* Node::*typeFunc)
191{
192 for (Node *plist = node; plist; plist = plist->next) {
193 const Identifier name(plist->name.toString());
194 const RangeInRevision range = m_session->locationToRange(plist->identifierToken);
195
196 AbstractType::Ptr type = (typeFunc ?
197 typeFromName((plist->*typeFunc)->name.toString()) : // The typeAttribute attribute of plist contains the type name of the argument
198 AbstractType::Ptr(new IntegralType(IntegralType::TypeMixed)) // No type information, use mixed
199 );
200
201 {
202 DUChainWriteLocker lock;
203 openDeclaration<Declaration>(name, range);
204 }
205 openType(type);
206 closeAndAssignType();
207
208 if (QmlJS::FunctionType::Ptr funType = currentType<QmlJS::FunctionType>()) {
209 funType->addArgument(type);
210 }
211 }
212}
213
214bool DeclarationBuilder::visit(QmlJS::AST::FunctionDeclaration* node)
215{

Callers

nothing calls this directly

Calls 3

locationToRangeMethod · 0.80
toStringMethod · 0.45
addArgumentMethod · 0.45

Tested by

no test coverage detected