forked from qt-creator/qt-creator
		
	Introduced token caching to prevent repetetive tokenizing.
Also removed TokenUnderCursor as it's functionality is in the token cache. Reviewed-by: ckamm
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user