From 2eb50afd9c9039f29d25171583e0270b5b1516ef Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 22 Oct 2021 15:48:59 +0200 Subject: [PATCH] LanguageClient: Fix document version update ... for empty semantic tokens delta. Amends 86061fb44a. Change-Id: Id6d6cdc1904ea5353d18cea57b55ed3fa16727de Reviewed-by: David Schulz --- src/plugins/languageclient/semantichighlightsupport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/languageclient/semantichighlightsupport.cpp b/src/plugins/languageclient/semantichighlightsupport.cpp index 66d6742b2bc..e30320ce982 100644 --- a/src/plugins/languageclient/semantichighlightsupport.cpp +++ b/src/plugins/languageclient/semantichighlightsupport.cpp @@ -392,6 +392,7 @@ void SemanticTokenSupport::handleSemanticTokensDelta( if (auto tokens = Utils::get_if(&result)) { m_tokens[filePath] = {*tokens, documentVersion}; } else if (auto tokensDelta = Utils::get_if(&result)) { + m_tokens[filePath].version = documentVersion; QList edits = tokensDelta->edits(); if (edits.isEmpty()) { highlight(filePath); @@ -400,7 +401,6 @@ void SemanticTokenSupport::handleSemanticTokensDelta( Utils::sort(edits, &SemanticTokensEdit::start); - m_tokens[filePath].version = documentVersion; SemanticTokens &tokens = m_tokens[filePath].tokens; const QList &data = tokens.data();