diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2021-12-03 16:25:16 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2021-12-08 09:46:25 +0000 |
commit | 67cf7c08d016b81b24fcd1fac0726708b744a5fe (patch) | |
tree | dba9aa66af12cff2f228bc185fdfc62e325c29d1 | |
parent | 0b736c3f7afe6589ea5dea146a171515693b16ae (diff) |
LanguageClient: More verbose logging when clearing token data
Change-Id: I3f9883858fa2f23dff00cda9f556f0f4bbff127a
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | src/plugins/languageclient/semantichighlightsupport.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/plugins/languageclient/semantichighlightsupport.cpp b/src/plugins/languageclient/semantichighlightsupport.cpp index 444cb23439..905ab0169a 100644 --- a/src/plugins/languageclient/semantichighlightsupport.cpp +++ b/src/plugins/languageclient/semantichighlightsupport.cpp @@ -206,6 +206,10 @@ void SemanticTokenSupport::reloadSemanticTokens(TextDocument *textDocument) const TextDocumentIdentifier docId(DocumentUri::fromFilePath(filePath)); auto responseCallback = [this, filePath, documentVersion = m_client->documentVersion(filePath)]( const SemanticTokensFullRequest::Response &response) { + if (const auto error = response.error()) { + qCDebug(LOGLSPHIGHLIGHT) + << "received error" << error->code() << error->message() << "for" << filePath; + } handleSemanticTokens(filePath, response.result().value_or(nullptr), documentVersion); }; /*if (supportedRequests.testFlag(SemanticRequestType::Range)) { @@ -251,6 +255,10 @@ void SemanticTokenSupport::updateSemanticTokens(TextDocument *textDocument) request.setResponseCallback( [this, filePath, documentVersion]( const SemanticTokensFullDeltaRequest::Response &response) { + if (const auto error = response.error()) { + qCDebug(LOGLSPHIGHLIGHT) << "received error" << error->code() + << error->message() << "for" << filePath; + } handleSemanticTokensDelta(filePath, response.result().value_or(nullptr), documentVersion); @@ -408,6 +416,9 @@ void SemanticTokenSupport::handleSemanticTokens(const Utils::FilePath &filePath, m_tokens[filePath] = {*tokens, documentVersion}; highlight(filePath); } else { + qCDebug(LOGLSPHIGHLIGHT) + << "no data in reply to full semantic tokens request, clearing tokens" + << m_client->name() << filePath; m_tokens.remove(filePath); } } @@ -476,8 +487,10 @@ void SemanticTokenSupport::handleSemanticTokensDelta( tokens.setData(newData); tokens.setResultId(tokensDelta->resultId()); } else { + qCDebug(LOGLSPHIGHLIGHT) + << "no data in reply to semantic tokens delta request, clearing tokens" + << m_client->name() << filePath; m_tokens.remove(filePath); - qCDebug(LOGLSPHIGHLIGHT) << "Data cleared"; return; } highlight(filePath); |