forked from qt-creator/qt-creator
CppEditor: Fully handle raw string literals in the syntax highlighter
As of a3af941adf, the built-in highlighter
can properly handle multi-line raw string literals, so we don't need to
abuse the semantic highlighter for this anymore.
Fixes: QTCREATORBUG-26693
Fixes: QTCREATORBUG-28284
Change-Id: If644767dfa8a97294e84a541eea44143e8d1bb88
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -599,10 +599,9 @@ void ExtraHighlightingResultsCollector::collectFromNode(const ClangdAstNode &nod
|
||||
if (node.kind().endsWith("Literal")) {
|
||||
const bool isKeyword = node.kind() == "CXXBoolLiteral"
|
||||
|| node.kind() == "CXXNullPtrLiteral";
|
||||
const bool isStringLike = !isKeyword && (node.kind().startsWith("String")
|
||||
|| node.kind().startsWith("Character"));
|
||||
const TextStyle style = isKeyword ? C_KEYWORD : isStringLike ? C_STRING : C_NUMBER;
|
||||
insertResult(node, style);
|
||||
if (!isKeyword && (node.kind().startsWith("String") || node.kind().startsWith("Character")))
|
||||
return;
|
||||
insertResult(node, isKeyword ? C_KEYWORD : C_NUMBER);
|
||||
return;
|
||||
}
|
||||
if (node.role() == "type" && node.kind() == "Builtin") {
|
||||
|
||||
Reference in New Issue
Block a user