ClangCodeModel: Ignore number literals

... in the semantic highlighter. The syntax highlighter already handles
these.

Change-Id: I26f6bca06c4fc648ffe59bd9e3639d81d2265755
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2023-01-31 18:13:42 +01:00
parent 8655603c2e
commit 7c6a00b4e7
4 changed files with 21 additions and 25 deletions

View File

@@ -594,16 +594,9 @@ void ExtraHighlightingResultsCollector::setResultPosFromRange(HighlightingResult
void ExtraHighlightingResultsCollector::collectFromNode(const ClangdAstNode &node)
{
if (node.kind() == "UserDefinedLiteral")
if (node.kind().endsWith("Literal"))
return;
if (node.kind().endsWith("Literal")) {
if (node.kind() == "CXXBoolLiteral" || node.kind() == "CXXNullPtrLiteral")
return;
if (node.kind().startsWith("String") || node.kind().startsWith("Character"))
return;
insertResult(node, C_NUMBER);
return;
}
if (node.role() == "type" && node.kind() == "Builtin") {
insertResult(node, C_PRIMITIVE_TYPE);
return;