Remove duplicated code from c++ and glsl completer.

Change-Id: Ibda04771fceffef6344f6a6128d77dd8192379ca
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
David Schulz
2016-04-15 09:35:20 +02:00
parent 61be239795
commit b482a6158c
5 changed files with 128 additions and 193 deletions

View File

@@ -36,9 +36,16 @@ namespace CPlusPlus {
class CPLUSPLUS_EXPORT MatchingText
{
public:
static bool contextAllowsAutoParentheses(const QTextCursor &cursor,
const QString &textToInsert);
static bool contextAllowsElectricCharacters(const QTextCursor &cursor);
static bool shouldInsertMatchingText(const QTextCursor &tc);
static bool shouldInsertMatchingText(QChar lookAhead);
static bool isInCommentHelper(const QTextCursor &currsor, Token *retToken = 0);
static bool isInStringHelper(const QTextCursor &cursor);
static QString insertMatchingBrace(const QTextCursor &tc, const QString &text,
QChar la, int *skippedChars);
static QString insertParagraphSeparator(const QTextCursor &tc);