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

Method typeFromClassName

plugins/qmljs/duchain/declarationbuilder.cpp:1399–1417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1397}
1398
1399AbstractType::Ptr DeclarationBuilder::typeFromClassName(const QString& name)
1400{
1401 DeclarationPointer decl = QmlJS::getDeclaration(QualifiedIdentifier(name), currentContext());
1402
1403 if (!decl) {
1404 if (name == QLatin1String("QRegExp")) {
1405 decl = QmlJS::NodeJS::instance().moduleMember(QStringLiteral("__builtin_ecmascript"), QStringLiteral("RegExp"), currentContext()->url());
1406 }
1407 }
1408
1409 if (decl) {
1410 return decl->abstractType();
1411 } else {
1412 DelayedType::Ptr type(new DelayedType);
1413 type->setKind(DelayedType::Unresolved);
1414 type->setIdentifier(IndexedTypeIdentifier(name));
1415 return type;
1416 }
1417}
1418
1419void DeclarationBuilder::addBaseClass(ClassDeclaration* classDecl, const QString& name)
1420{

Callers

nothing calls this directly

Calls 8

getDeclarationFunction · 0.85
moduleMemberMethod · 0.80
QualifiedIdentifierClass · 0.50
urlMethod · 0.45
abstractTypeMethod · 0.45
setKindMethod · 0.45
setIdentifierMethod · 0.45

Tested by

no test coverage detected