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

Method applyUpwardsAliases

kdevplatform/language/duchain/ducontext.cpp:1278–1303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1276}
1277
1278void DUContext::applyUpwardsAliases(SearchItem::PtrList& identifiers, const TopDUContext* /*source*/) const
1279{
1280 if (type() == Namespace) {
1281 if (d_func()->m_scopeIdentifier.isEmpty())
1282 return;
1283
1284 //Make sure we search for the items in all namespaces of the same name, by duplicating each one with the namespace-identifier prepended.
1285 //We do this by prepending items to the current identifiers that equal the local scope identifier.
1286 SearchItem::Ptr newItem(new SearchItem(d_func()->m_scopeIdentifier.identifier()));
1287
1288 //This will exclude explicitly global identifiers
1289 newItem->addToEachNode(identifiers);
1290
1291 if (!newItem->next.isEmpty()) {
1292 //Prepend the full scope before newItem
1293 DUContext* parent = m_dynamicData->m_parentContext.data();
1294 while (parent) {
1295 newItem = SearchItem::Ptr(new SearchItem(parent->d_func()->m_scopeIdentifier, newItem));
1296 parent = parent->m_dynamicData->m_parentContext.data();
1297 }
1298
1299 newItem->isExplicitlyGlobal = true;
1300 identifiers.insert(identifiers.begin(), newItem);
1301 }
1302 }
1303}
1304
1305bool DUContext::shouldSearchInParent(SearchFlags flags) const
1306{

Callers 1

fullyApplyAliasesMethod · 0.80

Calls 8

addToEachNodeMethod · 0.80
d_funcMethod · 0.80
typeFunction · 0.70
isEmptyMethod · 0.45
identifierMethod · 0.45
dataMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected