forked from qt-creator/qt-creator
CppEditor: Add soft assert for unexpected semantic highlighter state
Task-number: QTCREATORBUG-28507 Change-Id: I322c9b806c85d2a013c4014c80f4ca11ca117752 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -175,9 +175,12 @@ void SemanticHighlighter::onHighlighterResultAvailable(int from, int to)
|
|||||||
const QTextBlock lastBlockForResult = m_baseTextDocument->document()
|
const QTextBlock lastBlockForResult = m_baseTextDocument->document()
|
||||||
->findBlock(endRange);
|
->findBlock(endRange);
|
||||||
const QTextBlock endBlock = lastBlockForResult.next();
|
const QTextBlock endBlock = lastBlockForResult.next();
|
||||||
for (QTextBlock block = firstBlockForResult;
|
for (QTextBlock block = firstBlockForResult; block != endBlock; block = block.next()) {
|
||||||
block.isValid() && block != endBlock;
|
QTC_ASSERT(block.isValid(),
|
||||||
block = block.next()) {
|
qDebug() << from << to << i << result.line << result.column
|
||||||
|
<< firstBlockForResult.blockNumber() << firstBlockForResult.position()
|
||||||
|
<< lastBlockForResult.blockNumber() << lastBlockForResult.position();
|
||||||
|
break);
|
||||||
Parentheses syntacticParens = getClearedParentheses(block);
|
Parentheses syntacticParens = getClearedParentheses(block);
|
||||||
|
|
||||||
// Remove mis-detected parentheses inserted by syntactic highlighter.
|
// Remove mis-detected parentheses inserted by syntactic highlighter.
|
||||||
|
Reference in New Issue
Block a user