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

Method check

kdevplatform/language/duchain/ducontext.cpp:575–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573 }
574
575 Declaration* check(Declaration* declaration) const
576 {
577 ///@todo This is C++-specific
578 if (m_ownType != DUContext::Class && m_ownType != DUContext::Template
579 && m_position.isValid() && m_position <= declaration->range().start) {
580 return nullptr;
581 }
582
583 if (declaration->kind() == Declaration::Alias && !(m_flags & DUContext::DontResolveAliases)) {
584 //Apply alias declarations
585 auto* alias = static_cast<AliasDeclaration*>(declaration);
586 if (alias->aliasedDeclaration().isValid()) {
587 declaration = alias->aliasedDeclaration().declaration();
588 } else {
589 qCDebug(LANGUAGE) << "lost aliased declaration";
590 }
591 }
592
593 if (declaration->kind() == Declaration::NamespaceAlias && !(m_flags & DUContext::NoFiltering)) {
594 return nullptr;
595 }
596
597 if (( m_flags& DUContext::OnlyFunctions ) && !declaration->isFunctionDeclaration()) {
598 return nullptr;
599 }
600
601 if (m_dataType && m_dataType->indexed() != declaration->indexedType()) {
602 return nullptr;
603 }
604
605 return declaration;
606 }
607
608 DUContext::SearchFlags m_flags;
609 const AbstractType::Ptr m_dataType;

Callers 1

Calls 8

aliasedDeclarationMethod · 0.80
indexedTypeMethod · 0.80
isValidMethod · 0.45
rangeMethod · 0.45
kindMethod · 0.45
declarationMethod · 0.45
isFunctionDeclarationMethod · 0.45
indexedMethod · 0.45

Tested by

no test coverage detected