forked from qt-creator/qt-creator
Ensure we keep the context around for as long as it is needed.
This commit is contained in:
@@ -56,6 +56,19 @@ FindUsages::FindUsages(Document::Ptr doc, const Snapshot &snapshot)
|
||||
typeofExpression.init(_doc, _snapshot, _context.bindings());
|
||||
}
|
||||
|
||||
FindUsages::FindUsages(const LookupContext &context)
|
||||
: ASTVisitor(context.thisDocument()->translationUnit()),
|
||||
_doc(context.thisDocument()),
|
||||
_snapshot(context.snapshot()),
|
||||
_context(context),
|
||||
_source(_doc->source()),
|
||||
_sem(_doc->translationUnit()),
|
||||
_inSimpleDeclaration(0),
|
||||
_inQProperty(false)
|
||||
{
|
||||
typeofExpression.init(_doc, _snapshot, _context.bindings());
|
||||
}
|
||||
|
||||
QList<Usage> FindUsages::usages() const
|
||||
{ return _usages; }
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ class CPLUSPLUS_EXPORT FindUsages: protected ASTVisitor
|
||||
{
|
||||
public:
|
||||
FindUsages(Document::Ptr doc, const Snapshot &snapshot);
|
||||
FindUsages(const LookupContext &context);
|
||||
|
||||
void operator()(Symbol *symbol);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user