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

Method collectItems

kdevplatform/language/duchain/duchainutils.cpp:378–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378void DUChainUtils::collectItems( DUContext* context, DUChainItemFilter& filter ) {
379
380 QVector<DUContext*> children = context->childContexts();
381 QVector<Declaration*> localDeclarations = context->localDeclarations();
382
383 QVector<DUContext*>::const_iterator childIt = children.constBegin();
384 QVector<Declaration*>::const_iterator declIt = localDeclarations.constBegin();
385
386 while(childIt != children.constEnd() || declIt != localDeclarations.constEnd()) {
387
388 DUContext* child = nullptr;
389 if(childIt != children.constEnd())
390 child = *childIt;
391
392 Declaration* decl = nullptr;
393 if(declIt != localDeclarations.constEnd())
394 decl = *declIt;
395
396 if(decl) {
397 if(child && child->range().start.line >= decl->range().start.line)
398 child = nullptr;
399 }
400
401 if(child) {
402 if(decl && decl->range().start >= child->range().start)
403 decl = nullptr;
404 }
405
406 if(decl) {
407 if( filter.accept(decl) ) {
408 //Action is done in the filter
409 }
410
411 ++declIt;
412 continue;
413 }
414
415 if(child) {
416 if( filter.accept(child) )
417 collectItems(child, filter);
418 ++childIt;
419 continue;
420 }
421 }
422}
423
424KDevelop::DUContext* DUChainUtils::argumentContext(KDevelop::Declaration* decl) {
425 DUContext* internal = decl->internalContext();

Callers

nothing calls this directly

Calls 6

childContextsMethod · 0.80
localDeclarationsMethod · 0.80
constBeginMethod · 0.80
constEndMethod · 0.80
rangeMethod · 0.45
acceptMethod · 0.45

Tested by

no test coverage detected