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

Method findContext

kdevplatform/language/duchain/ducontext.cpp:910–929  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

908}
909
910DUContext* DUContext::findContext(const CursorInRevision& position, DUContext* parent) const
911{
912 ENSURE_CAN_READ
913
914 if (!parent)
915 parent = const_cast<DUContext*>(this);
916
917 for (DUContext* context : std::as_const(parent->m_dynamicData->m_childContexts)) {
918 if (context->range().contains(position)) {
919 DUContext* ret = findContext(position, context);
920 if (!ret) {
921 ret = context;
922 }
923
924 return ret;
925 }
926 }
927
928 return nullptr;
929}
930
931bool DUContext::parentContextOf(DUContext* context) const
932{

Callers 2

cursorContextDeclarationFunction · 0.80

Calls 2

containsMethod · 0.45
rangeMethod · 0.45

Tested by

no test coverage detected