Introduced a token cache for the C++ editor.

This should speed things up a bit, because before, the line was tokenized at
least 3 times.
This commit is contained in:
Erik Verbruggen
2010-06-04 09:36:05 +02:00
parent 414d9fe3e0
commit c2393df023
23 changed files with 244 additions and 86 deletions

View File

@@ -36,6 +36,7 @@
#include <QSharedPointer>
#include <QTextCursor>
#include <cplusplus/CppDocument.h>
#include <cplusplus/TokenCache.h>
QT_BEGIN_NAMESPACE
class QTimer;
@@ -72,6 +73,8 @@ public:
QString contents();
unsigned editorRevision() const;
CPlusPlus::TokenCache *tokenCache();
Q_SIGNALS:
void contentsChanged();
@@ -89,6 +92,7 @@ private:
QFuture<void> _documentParser;
QString _cachedContents;
unsigned _revision;
CPlusPlus::TokenCache _tokenCache;
};
} // namespace Internal