From afedec330a9be2378009c5497bbb8b88efd4255d Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 7 Oct 2009 14:33:37 +0200 Subject: [PATCH] Run the binder before searching strong and weak references. --- src/plugins/cpptools/cppfindreferences.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp index 26f9a18696..40259589a2 100644 --- a/src/plugins/cpptools/cppfindreferences.cpp +++ b/src/plugins/cpptools/cppfindreferences.cpp @@ -49,6 +49,7 @@ #include #include +#include #include #include #include @@ -81,6 +82,11 @@ public: _snapshot.insert(_doc); } + void setGlobalNamespaceBinding(NamespaceBindingPtr globalNamespaceBinding) + { + _globalNamespaceBinding = globalNamespaceBinding; + } + QList operator()(Symbol *symbol, Identifier *id, AST *ast) { _references.clear(); @@ -419,6 +425,7 @@ private: QByteArray _source; Document::Ptr _exprDoc; Semantic _sem; + NamespaceBindingPtr _globalNamespaceBinding; QList _postfixExpressionStack; QList _qualifiedNameStack; QList _references; @@ -456,6 +463,7 @@ QList CppFindReferences::references(Symbol *symbol, Q_ASSERT(translationUnit != 0); Process process(doc, snapshot, /*future = */ 0); + process.setGlobalNamespaceBinding(bind(doc, snapshot)); references = process(symbol, id, translationUnit->ast()); return references; @@ -542,6 +550,7 @@ static void find_helper(QFutureInterface &future, tm.start(); Process process(doc, snapshot, &future); + process.setGlobalNamespaceBinding(bind(doc, snapshot)); TranslationUnit *unit = doc->translationUnit(); process(symbol, id, unit->ast()); -- GitLab