From 91b527427612d8a898746d13ec48a6fb15c1d335 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 4 Jan 2023 10:18:59 +0100 Subject: [PATCH] ClangCodeModel: do not highlight tokens as Text Fixes: QTCREATORBUG-28639 Fixes: QTCREATORBUG-28637 Change-Id: Idfcfc6c61db9d5449ab14eda566ce704160bac54 Reviewed-by: Reviewed-by: David Schulz --- src/plugins/clangcodemodel/clangdsemantichighlighting.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp b/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp index 322a21058ff..e40f68d9107 100644 --- a/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp +++ b/src/plugins/clangcodemodel/clangdsemantichighlighting.cpp @@ -366,6 +366,10 @@ void doSemanticHighlighting( const QList ifdefedOutBlocks = cleanupDisabledCode(results, &doc, docContents); ExtraHighlightingResultsCollector(future, results, filePath, ast, &doc, docContents, clangdVersion).collect(); + Utils::erase(results, [](const HighlightingResult &res) { + // QTCREATORBUG-28639 + return res.textStyles.mainStyle == C_TEXT && res.textStyles.mixinStyles.empty(); + }); if (!future.isCanceled()) { qCInfo(clangdLogHighlight) << "reporting" << results.size() << "highlighting results"; QMetaObject::invokeMethod(textDocument, [textDocument, ifdefedOutBlocks, docRevision] {