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

Method context

kdevplatform/language/duchain/ducontext.cpp:1671–1691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1669}
1670
1671DUContext* DUContext::Import::context(const TopDUContext* topContext, bool instantiateIfRequired) const
1672{
1673 if (m_declaration.isValid()) {
1674 Declaration* decl = m_declaration.declaration(topContext, instantiateIfRequired);
1675 //This first case rests on the assumption that no context will ever import a function's expression context
1676 //More accurately, that no specialized or cross-topContext imports will, but if the former assumption fails the latter will too
1677 if (auto* functionDecl = dynamic_cast<AbstractFunctionDeclaration*>(decl)) {
1678 if (functionDecl->internalFunctionContext()) {
1679 return functionDecl->internalFunctionContext();
1680 } else {
1681 qCWarning(LANGUAGE) << "Import of function declaration without internal function context encountered!";
1682 }
1683 }
1684 if (decl)
1685 return decl->logicalInternalContext(topContext);
1686 else
1687 return nullptr;
1688 } else {
1689 return m_context.data();
1690 }
1691}
1692
1693bool DUContext::Import::isDirect() const
1694{

Callers 15

getImportsFromDUMethod · 0.45
operator()Method · 0.45
indexForParentContextFunction · 0.45
addDeclarationMethod · 0.45
dotGraphInternalMethod · 0.45
FOREACH_FUNCTIONMethod · 0.45
rebuildStructureMethod · 0.45
completionPropertiesMethod · 0.45

Calls 5

isValidMethod · 0.45
declarationMethod · 0.45
dataMethod · 0.45

Tested by 3

applySpecializationMethod · 0.36
ContextTestFunction · 0.36
DeclarationTestFunction · 0.36