LanguageClient: make sure to send a response to a request

Restructure the message handling in the client, so if we get a message
with an id always send a response to the server either with the result
or with an error. Also make sure to not send responses to unreachable
server.

Change-Id: Ie74128069c1678af60871896d5dce45c08e71b05
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2021-11-18 08:51:35 +01:00
parent 67971d2855
commit f16a473b3b
2 changed files with 101 additions and 57 deletions

View File

@@ -233,8 +233,8 @@ private:
bool sendWorkspceFolderChanges() const;
void log(const LanguageServerProtocol::ShowMessageParams &message);
void showMessageBox(const LanguageServerProtocol::ShowMessageRequestParams &message,
const LanguageServerProtocol::MessageId &id);
LanguageServerProtocol::LanguageClientValue<LanguageServerProtocol::MessageActionItem>
showMessageBox(const LanguageServerProtocol::ShowMessageRequestParams &message);
void removeDiagnostics(const LanguageServerProtocol::DocumentUri &uri);
void resetAssistProviders(TextEditor::TextDocument *document);