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

Method environmentFileForDocument

kdevplatform/language/duchain/duchain.cpp:1509–1531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1507}
1508
1509ParsingEnvironmentFilePointer DUChain::environmentFileForDocument(const IndexedString& document,
1510 const ParsingEnvironment* environment,
1511 bool proxyContext) const
1512{
1513 ENSURE_CHAIN_READ_LOCKED;
1514
1515 if (sdDUChainPrivate->m_destroyed)
1516 return ParsingEnvironmentFilePointer();
1517 const QList<ParsingEnvironmentFilePointer> list = sdDUChainPrivate->getEnvironmentInformation(document);
1518
1519// qCDebug(LANGUAGE) << document.str() << ": matching" << list.size() << (onlyProxyContexts ? "proxy-contexts" : (noProxyContexts ? "content-contexts" : "contexts"));
1520
1521 for (auto& envFilePtr : list) {
1522 if (envFilePtr && (envFilePtr->isProxyContext() == proxyContext) && envFilePtr->matchEnvironment(environment) &&
1523 // Verify that the environment-file and its top-context are "good": The top-context must exist,
1524 // and there must be a content-context associated to the proxy-context.
1525 envFilePtr->topContext() &&
1526 (!proxyContext || DUChainUtils::contentContextFromProxyContext(envFilePtr->topContext()))) {
1527 return envFilePtr;
1528 }
1529 }
1530 return ParsingEnvironmentFilePointer();
1531}
1532
1533QList<ParsingEnvironmentFilePointer> DUChain::allEnvironmentFiles(const IndexedString& document)
1534{

Callers 4

importsMethod · 0.80
importersMethod · 0.80
addContextsForRemovalMethod · 0.80

Calls 6

isProxyContextMethod · 0.80
loadInformationMethod · 0.80
matchEnvironmentMethod · 0.45
topContextMethod · 0.45
indexMethod · 0.45

Tested by 1