diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index a89ef2a821b..bd2c85e1916 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -482,12 +482,13 @@ void Client::openDocument(TextEditor::TextDocument *document) } } -void Client::sendMessage(const JsonRpcMessage &message, SendDocUpdates sendUpdates) +void Client::sendMessage(const JsonRpcMessage &message, SendDocUpdates sendUpdates, + Schedule semanticTokensSchedule) { QTC_ASSERT(m_clientInterface, return); QTC_ASSERT(m_state == Initialized, return); if (sendUpdates == SendDocUpdates::Send) - sendPostponedDocumentUpdates(Schedule::Delayed); + sendPostponedDocumentUpdates(semanticTokensSchedule); if (Utils::optional responseHandler = message.responseHandler()) m_responseHandlers[responseHandler->id] = responseHandler->callback; QString error; @@ -749,7 +750,7 @@ void Client::documentContentsSaved(TextEditor::TextDocument *document) TextDocumentIdentifier(DocumentUri::fromFilePath(document->filePath()))); if (includeText) params.setText(document->plainText()); - sendMessage(DidSaveTextDocumentNotification(params)); + sendMessage(DidSaveTextDocumentNotification(params), SendDocUpdates::Send, Schedule::Now); } void Client::documentWillSave(Core::IDocument *document) diff --git a/src/plugins/languageclient/client.h b/src/plugins/languageclient/client.h index 80a6f3144f0..2f1661a6f4a 100644 --- a/src/plugins/languageclient/client.h +++ b/src/plugins/languageclient/client.h @@ -102,7 +102,8 @@ public: enum class SendDocUpdates { Send, Ignore }; void sendMessage(const LanguageServerProtocol::JsonRpcMessage &message, - SendDocUpdates sendUpdates = SendDocUpdates::Send); + SendDocUpdates sendUpdates = SendDocUpdates::Send, + Schedule semanticTokensSchedule = Schedule::Delayed); void cancelRequest(const LanguageServerProtocol::MessageId &id);