Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
afedec33
Commit
afedec33
authored
Oct 07, 2009
by
Roberto Raggi
Browse files
Run the binder before searching strong and weak references.
parent
f19ce6c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppfindreferences.cpp
View file @
afedec33
...
...
@@ -49,6 +49,7 @@
#include
<Scope.h>
#include
<cplusplus/CppDocument.h>
#include
<cplusplus/CppBindings.h>
#include
<cplusplus/ExpressionUnderCursor.h>
#include
<cplusplus/ResolveExpression.h>
#include
<cplusplus/Overview.h>
...
...
@@ -81,6 +82,11 @@ public:
_snapshot
.
insert
(
_doc
);
}
void
setGlobalNamespaceBinding
(
NamespaceBindingPtr
globalNamespaceBinding
)
{
_globalNamespaceBinding
=
globalNamespaceBinding
;
}
QList
<
int
>
operator
()(
Symbol
*
symbol
,
Identifier
*
id
,
AST
*
ast
)
{
_references
.
clear
();
...
...
@@ -419,6 +425,7 @@ private:
QByteArray
_source
;
Document
::
Ptr
_exprDoc
;
Semantic
_sem
;
NamespaceBindingPtr
_globalNamespaceBinding
;
QList
<
PostfixExpressionAST
*>
_postfixExpressionStack
;
QList
<
QualifiedNameAST
*>
_qualifiedNameStack
;
QList
<
int
>
_references
;
...
...
@@ -456,6 +463,7 @@ QList<int> 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<Utils::FileSearchResult> &future,
tm
.
start
();
Process
process
(
doc
,
snapshot
,
&
future
);
process
.
setGlobalNamespaceBinding
(
bind
(
doc
,
snapshot
));
TranslationUnit
*
unit
=
doc
->
translationUnit
();
process
(
symbol
,
id
,
unit
->
ast
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment