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

Method findContextAt

kdevplatform/language/duchain/ducontext.cpp:1371–1390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1369}
1370
1371DUContext* DUContext::findContextAt(const CursorInRevision& position, bool includeRightBorder) const
1372{
1373 ENSURE_CAN_READ
1374
1375// qCDebug(LANGUAGE) << "searching" << position << "in:" << scopeIdentifier(true).toString() << range() << includeRightBorder;
1376
1377 if (!range().contains(position) && (!includeRightBorder || range().end != position)) {
1378// qCDebug(LANGUAGE) << "mismatch";
1379 return nullptr;
1380 }
1381
1382 const auto childContexts = m_dynamicData->m_childContexts;
1383 for (int a = childContexts.size() - 1; a >= 0; --a) {
1384 if (DUContext* specific = childContexts[a]->findContextAt(position, includeRightBorder)) {
1385 return specific;
1386 }
1387 }
1388
1389 return const_cast<DUContext*>(this);
1390}
1391
1392Declaration* DUContext::findDeclarationAt(const CursorInRevision& position) const
1393{

Callers 10

contextForHighlightingAtFunction · 0.80
VisitorMethod · 0.80
findDeclarationMethod · 0.80
getDeclarationAtCursorFunction · 0.80
completionItemsMethod · 0.80
prepareCompletionFunction · 0.80
loadDeclarationsMethod · 0.80

Calls 3

rangeFunction · 0.85
containsMethod · 0.45
sizeMethod · 0.45

Tested by 2

prepareCompletionFunction · 0.64
loadDeclarationsMethod · 0.64