| 781 | } |
| 782 | |
| 783 | QList<Declaration*> DUContext::findDeclarations(const QualifiedIdentifier& identifier, |
| 784 | const CursorInRevision& position, |
| 785 | const AbstractType::Ptr& dataType, |
| 786 | const TopDUContext* topContext, SearchFlags flags) const |
| 787 | { |
| 788 | ENSURE_CAN_READ |
| 789 | |
| 790 | DeclarationList ret; |
| 791 | // optimize: we don't want to allocate the top node always |
| 792 | // so create it on stack but ref it so its not deleted by the smart pointer |
| 793 | SearchItem item(identifier); |
| 794 | item.ref.ref(); |
| 795 | |
| 796 | SearchItem::PtrList identifiers{SearchItem::Ptr(&item)}; |
| 797 | |
| 798 | findDeclarationsInternal(identifiers, |
| 799 | position.isValid() ? position : range().end, dataType, ret, |
| 800 | topContext ? topContext : this->topContext(), flags, 0); |
| 801 | |
| 802 | return ret; |
| 803 | } |
| 804 | |
| 805 | bool DUContext::imports(const DUContext* origin, const CursorInRevision& /*position*/) const |
| 806 | { |