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:
@@ -47,28 +47,29 @@ class CPLUSPLUS_EXPORT FastPreprocessor: public Client
|
||||
Snapshot _snapshot;
|
||||
Preprocessor _preproc;
|
||||
QSet<QString> _merged;
|
||||
Document::Ptr _currentDoc;
|
||||
|
||||
void mergeEnvironment(const QString &fileName);
|
||||
|
||||
public:
|
||||
FastPreprocessor(const Snapshot &snapshot);
|
||||
|
||||
QByteArray run(QString fileName, const QString &source);
|
||||
QByteArray run(Document::Ptr newDoc, const QString &source);
|
||||
|
||||
// CPlusPlus::Client
|
||||
virtual void sourceNeeded(unsigned, QString &fileName, IncludeType);
|
||||
virtual void sourceNeeded(unsigned line, QString &fileName, IncludeType);
|
||||
|
||||
virtual void macroAdded(const Macro &) {}
|
||||
virtual void macroAdded(const Macro &);
|
||||
|
||||
virtual void passedMacroDefinitionCheck(unsigned, unsigned, const Macro &) {}
|
||||
virtual void failedMacroDefinitionCheck(unsigned, const ByteArrayRef &) {}
|
||||
virtual void passedMacroDefinitionCheck(unsigned, unsigned, const Macro &);
|
||||
virtual void failedMacroDefinitionCheck(unsigned, const ByteArrayRef &);
|
||||
|
||||
virtual void notifyMacroReference(unsigned, unsigned, const Macro &) {}
|
||||
virtual void notifyMacroReference(unsigned, unsigned, const Macro &);
|
||||
|
||||
virtual void startExpandingMacro(unsigned,
|
||||
unsigned,
|
||||
const Macro &,
|
||||
const QVector<MacroArgumentReference> &) {}
|
||||
const QVector<MacroArgumentReference> &);
|
||||
virtual void stopExpandingMacro(unsigned, const Macro &) {}
|
||||
|
||||
virtual void startSkippingBlocks(unsigned) {}
|
||||
|
||||
Reference in New Issue
Block a user