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

Method functionContext

kdevplatform/language/duchain/duchainutils.cpp:598–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596}
597
598DUContext* DUChainUtils::functionContext(Declaration* decl) {
599 DUContext* functionContext = decl->internalContext();
600 if(functionContext && functionContext->type() != DUContext::Function) {
601 const auto importedParentContexts = functionContext->importedParentContexts();
602 for (const DUContext::Import& import : importedParentContexts) {
603 DUContext* ctx = import.context(decl->topContext());
604 if(ctx && ctx->type() == DUContext::Function)
605 functionContext = ctx;
606 }
607 }
608
609 if(functionContext && functionContext->type() == DUContext::Function)
610 return functionContext;
611 return nullptr;
612}
613
614QVector<KDevelop::Problem::Ptr> KDevelop::DUChainUtils::allProblemsForContext(const KDevelop::ReferencedTopDUContext& top)
615{

Callers

nothing calls this directly

Calls 5

internalContextMethod · 0.45
typeMethod · 0.45
contextMethod · 0.45
topContextMethod · 0.45

Tested by

no test coverage detected