forked from qt-creator/qt-creator
AutoTest: Avoid invalid parse results
If the document gets updated while typing we can get different results when fetching the content and using positions inside the content which might have updated milliseconds later. Beside fetching only once ensure valid parse results by adding an additional check for the used visitor. Change-Id: Id1ba4a139a4dc497be0fbb5cf1f81004f3f8676c Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -52,6 +52,7 @@ public:
|
||||
virtual ~TestVisitor();
|
||||
|
||||
QMap<QString, TestCodeLocationAndType> privateSlots() const { return m_privSlots; }
|
||||
bool resultValid() const { return m_valid; }
|
||||
|
||||
bool visit(CPlusPlus::Class *symbol);
|
||||
|
||||
@@ -59,6 +60,7 @@ private:
|
||||
CppTools::SymbolFinder m_symbolFinder;
|
||||
QString m_className;
|
||||
QMap<QString, TestCodeLocationAndType> m_privSlots;
|
||||
bool m_valid = false;
|
||||
};
|
||||
|
||||
class TestAstVisitor : public CPlusPlus::ASTVisitor
|
||||
|
||||
Reference in New Issue
Block a user