forked from qt-creator/qt-creator
C++: Fix outdated macro usage info in documents.
Record revisions of documents in macro definitions and usages. Then, when searching for usages, check the revision of the documents against the revision of the macros. If they are out-of-sync, repreprocess the documents to get up-to-date info. Task-number: QTCREATORBUG-7872 Change-Id: I846bb52ec660024728ab117a9fb7e43382a50e63 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -79,7 +79,8 @@ public:
|
||||
|
||||
void appendMacro(const Macro ¯o);
|
||||
void addMacroUse(const Macro ¯o, unsigned offset, unsigned length,
|
||||
unsigned beginLine, const QVector<MacroArgumentReference> &range);
|
||||
unsigned beginLine,
|
||||
const QVector<MacroArgumentReference> &range);
|
||||
void addUndefinedMacroUse(const QByteArray &name, unsigned offset);
|
||||
|
||||
Control *control() const;
|
||||
@@ -254,8 +255,7 @@ public:
|
||||
unsigned _beginLine;
|
||||
|
||||
public:
|
||||
inline MacroUse(const Macro ¯o,
|
||||
unsigned begin, unsigned end, unsigned beginLine)
|
||||
inline MacroUse(const Macro ¯o, unsigned begin, unsigned end, unsigned beginLine)
|
||||
: Block(begin, end),
|
||||
_macro(macro),
|
||||
_beginLine(beginLine)
|
||||
@@ -371,10 +371,10 @@ public:
|
||||
|
||||
Snapshot simplified(Document::Ptr doc) const;
|
||||
|
||||
QByteArray preprocessedCode(const QString &source,
|
||||
const QString &fileName) const;
|
||||
Document::Ptr preprocessedDocument(const QString &source,
|
||||
const QString &fileName) const;
|
||||
|
||||
Document::Ptr documentFromSource(const QByteArray &preprocessedCode,
|
||||
Document::Ptr documentFromSource(const QByteArray &preprocessedDocument,
|
||||
const QString &fileName) const;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user