Editor: add start/end block logging to syntaxhighlighter

Change-Id: I9d3ac6394e3010ac77e534158106493ba886ab46
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
David Schulz
2024-12-09 10:37:07 +01:00
parent e054c9e329
commit dca49744a0

View File

@@ -15,6 +15,8 @@
#include <cmath>
Q_LOGGING_CATEGORY(Log, "qtc.editor.syntaxhighlighter", QtWarningMsg)
namespace TextEditor {
enum HighlighterTypeProperty
@@ -208,6 +210,7 @@ void SyntaxHighlighterPrivate::reformatBlocks(int from, int charsRemoved, int ch
else if (block.blockNumber() > highlightEndBlock)
highlightEndBlock = block.blockNumber();
qCDebug(Log) << "reformat blocks from:" << from << "to:" << from + charsAdded - charsRemoved;
reformatBlocks();
}
@@ -222,6 +225,8 @@ void SyntaxHighlighterPrivate::reformatBlocks()
foldValidator.reset();
bool forceHighlightOfNextBlock = false;
qCDebug(Log) << "continue reformat blocks start block:" << highlightStartBlock
<< "end block:" << highlightEndBlock << "blockCount:" << doc->blockCount();
QTextBlock block = doc->findBlockByNumber(highlightStartBlock);
QTC_ASSERT(block.isValid(), block = doc->firstBlock());
QTextBlock endBlock = doc->findBlockByNumber(highlightEndBlock);
@@ -256,6 +261,7 @@ void SyntaxHighlighterPrivate::reformatBlocks()
} else {
highlightEndBlock = 0;
highlightStartBlock = INT_MAX;
qCDebug(Log) << "reformat blocks done";
syntaxInfoUpToDate = true;
emit q->finished();
}