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();