CppEditor: Fix highlighting of raw string literals

... with the built-in highlighter.
Pass the necessary context information in and out of the SimpleLexer.

Task-number: QTCREATORBUG-26211
Fixes: QTCREATORBUG-26425
Fixes: QTCREATORBUG-26615
Change-Id: Id72f743e07ae117ca51b0d5e527b208dda133b7e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-12-08 13:57:24 +01:00
parent 3eef024960
commit a3af941adf
7 changed files with 79 additions and 22 deletions

View File

@@ -523,6 +523,22 @@ void TextDocumentLayout::setFolded(const QTextBlock &block, bool folded)
emit layout->foldChanged(block.blockNumber(), folded);
}
void TextDocumentLayout::setExpectedRawStringSuffix(const QTextBlock &block,
const QByteArray &suffix)
{
if (TextBlockUserData * const data = textUserData(block))
data->setExpectedRawStringSuffix(suffix);
else if (!suffix.isEmpty())
userData(block)->setExpectedRawStringSuffix(suffix);
}
QByteArray TextDocumentLayout::expectedRawStringSuffix(const QTextBlock &block)
{
if (TextBlockUserData *userData = textUserData(block))
return userData->expectedRawStringSuffix();
return {};
}
void TextDocumentLayout::requestExtraAreaUpdate()
{
emit updateExtraArea();