summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus/MatchingText.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@nokia.com>2010-06-04 09:36:05 +0200
committerErik Verbruggen <erik.verbruggen@nokia.com>2010-06-04 09:36:05 +0200
commitc2393df02332618c8cf6159d9d6f6a40041ced89 (patch)
tree4230c145cc5fa6576310afebe989003151ed38d1 /src/libs/cplusplus/MatchingText.h
parent414d9fe3e0fe03f27432b9943e7b2bb5bc2f716c (diff)
downloadqt-creator-c2393df02332618c8cf6159d9d6f6a40041ced89.tar.gz
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.
Diffstat (limited to 'src/libs/cplusplus/MatchingText.h')
-rw-r--r--src/libs/cplusplus/MatchingText.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libs/cplusplus/MatchingText.h b/src/libs/cplusplus/MatchingText.h
index 5a49fa927c..8e42dc0f81 100644
--- a/src/libs/cplusplus/MatchingText.h
+++ b/src/libs/cplusplus/MatchingText.h
@@ -35,11 +35,12 @@
namespace CPlusPlus {
class BackwardsScanner;
+class TokenCache;
class CPLUSPLUS_EXPORT MatchingText
{
public:
- MatchingText();
+ MatchingText(TokenCache *tokenCache);
static bool shouldInsertMatchingText(const QTextCursor &tc);
static bool shouldInsertMatchingText(const QChar &lookAhead);
@@ -50,6 +51,8 @@ public:
private:
bool shouldInsertNewline(const QTextCursor &tc) const;
+
+ TokenCache *_tokenCache;
};
} // end of namespace CPlusPlus