From dca49744a0f20e84ac3ad49177ee09bfd8cf17a3 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 9 Dec 2024 10:37:07 +0100 Subject: [PATCH] Editor: add start/end block logging to syntaxhighlighter Change-Id: I9d3ac6394e3010ac77e534158106493ba886ab46 Reviewed-by: hjk --- src/plugins/texteditor/syntaxhighlighter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/texteditor/syntaxhighlighter.cpp b/src/plugins/texteditor/syntaxhighlighter.cpp index 1c16870d7a6..4585b2bb998 100644 --- a/src/plugins/texteditor/syntaxhighlighter.cpp +++ b/src/plugins/texteditor/syntaxhighlighter.cpp @@ -15,6 +15,8 @@ #include +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(); }