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

Method logicalInternalContext

kdevplatform/language/duchain/declaration.cpp:396–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396DUContext* Declaration::logicalInternalContext(const TopDUContext* topContext) const
397{
398 ENSURE_CAN_READ
399
400 if (!isDefinition()) {
401 Declaration* def = FunctionDefinition::definition(this);
402 if (def)
403 return def->internalContext();
404 }
405
406 if (d_func()->m_isTypeAlias) {
407 ///If this is a type-alias, return the internal context of the actual type.
408 TypeAliasType::Ptr t = type<TypeAliasType>();
409 if (t) {
410 AbstractType::Ptr target = t->type();
411
412 auto* idType = dynamic_cast<IdentifiedType*>(target.data());
413 if (idType) {
414 Declaration* decl = idType->declaration(topContext);
415 if (decl && decl != this) {
416 return decl->logicalInternalContext(topContext);
417 }
418 }
419 }
420 }
421
422 return internalContext();
423}
424
425DUContext* Declaration::internalContext() const
426{

Callers 2

contextMethod · 0.45
contextImportDeclFunction · 0.45

Calls 5

isDefinitionFunction · 0.85
internalContextMethod · 0.45
typeMethod · 0.45
dataMethod · 0.45
declarationMethod · 0.45

Tested by

no test coverage detected