LanguageServerProtocol: remove IContent

Do not pretend to support multiple message types, while no other
messages are actually implemented by us or even known to exist in the
wild.

Change-Id: I49ee2118b2e10f265ac641c195df8a9e5c97951c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
David Schulz
2022-05-12 09:51:39 +02:00
parent 6511bcdd72
commit a493970e05
22 changed files with 170 additions and 251 deletions

View File

@@ -101,7 +101,7 @@ public:
QString name() const;
enum class SendDocUpdates { Send, Ignore };
void sendContent(const LanguageServerProtocol::IContent &content,
void sendMessage(const LanguageServerProtocol::JsonRpcMessage &message,
SendDocUpdates sendUpdates = SendDocUpdates::Send);
void cancelRequest(const LanguageServerProtocol::MessageId &id);
@@ -226,17 +226,17 @@ protected:
void setError(const QString &message);
void setProgressTitleForToken(const LanguageServerProtocol::ProgressToken &token,
const QString &message);
void handleContent(const LanguageServerProtocol::JsonRpcMessage &message);
void handleMessage(const LanguageServerProtocol::JsonRpcMessage &message);
virtual void handleDiagnostics(const LanguageServerProtocol::PublishDiagnosticsParams &params);
virtual DiagnosticManager *createDiagnosticManager();
private:
void sendContentNow(const LanguageServerProtocol::IContent &content);
void sendMessageNow(const LanguageServerProtocol::JsonRpcMessage &message);
void handleResponse(const LanguageServerProtocol::MessageId &id,
const LanguageServerProtocol::IContent &content);
const LanguageServerProtocol::JsonRpcMessage &message);
void handleMethod(const QString &method,
const LanguageServerProtocol::MessageId &id,
const LanguageServerProtocol::IContent &content);
const LanguageServerProtocol::JsonRpcMessage &message);
void initializeCallback(const LanguageServerProtocol::InitializeRequest::Response &initResponse);
void shutDownCallback(const LanguageServerProtocol::ShutdownRequest::Response &shutdownResponse);
@@ -268,10 +268,6 @@ private:
virtual QTextCursor adjustedCursorForHighlighting(const QTextCursor &cursor,
TextEditor::TextDocument *doc);
using ContentHandler = std::function<void(const QByteArray &, QTextCodec *, QString &,
LanguageServerProtocol::ResponseHandlers,
LanguageServerProtocol::MethodHandler)>;
State m_state = Uninitialized;
QHash<LanguageServerProtocol::MessageId,
LanguageServerProtocol::ResponseHandler::Callback> m_responseHandlers;