From a08e0f7a9dab2271aee781fc194e58fb10283462 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 17 Feb 2022 15:54:37 +0100 Subject: [PATCH] ClangCodeModel: Differentiate between clangd debug output log levels Depending on the kind of highlighting issue we want to debug, we may or may not be interested in the actual tokens. Change-Id: I412126d3e97949a31f1dd5f339dc09072f28be64 Reviewed-by: Reviewed-by: David Schulz --- src/plugins/clangcodemodel/clangdclient.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index ab7a1ae5a06..ef10edd5eb1 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -2854,9 +2854,10 @@ void ClangdClient::Private::handleSemanticTokens(TextDocument *doc, int version, bool force) { SubtaskTimer t(highlightingTimer); - qCDebug(clangdLog) << "handling LSP tokens" << doc->filePath() << tokens.size(); + qCInfo(clangdLogHighlight) << "handling LSP tokens" << doc->filePath() + << version << tokens.size(); if (version != q->documentVersion(doc->filePath())) { - qCDebug(clangdLogHighlight) << "LSP tokens outdated; aborting highlighting procedure" + qCInfo(clangdLogHighlight) << "LSP tokens outdated; aborting highlighting procedure" << version << q->documentVersion(doc->filePath()); return; } @@ -2864,7 +2865,7 @@ void ClangdClient::Private::handleSemanticTokens(TextDocument *doc, const auto previous = previousTokens.find(doc); if (previous != previousTokens.end()) { if (!force && previous->first == tokens && previous->second == version) { - qCDebug(clangdLogHighlight) << "tokens and version same as last time; nothing to do"; + qCInfo(clangdLogHighlight) << "tokens and version same as last time; nothing to do"; return; } previous->first = tokens; @@ -2881,7 +2882,7 @@ void ClangdClient::Private::handleSemanticTokens(TextDocument *doc, if (!q->documentOpen(doc)) return; if (version != q->documentVersion(doc->filePath())) { - qCDebug(clangdLogHighlight) << "AST not up to date; aborting highlighting procedure" + qCInfo(clangdLogHighlight) << "AST not up to date; aborting highlighting procedure" << version << q->documentVersion(doc->filePath()); return; }