| 596 | } |
| 597 | |
| 598 | DUContext* 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 | |
| 614 | QVector<KDevelop::Problem::Ptr> KDevelop::DUChainUtils::allProblemsForContext(const KDevelop::ReferencedTopDUContext& top) |
| 615 | { |
nothing calls this directly
no test coverage detected