forked from qt-creator/qt-creator
LanguageClient: Move the BaseMessage to JsonRpcMessage conversion
... to the client interface. JsonRpcMessages are the only messages used so far and no other types of messages are currently used by any of the supported Language Servers. If a client is going to need special message parsing it can still implement a specialized client interface and overwrite parseCurrentMessage. This is the preparation to move receiving and parsing data passed to and from the language server out of the GUI thread. Change-Id: Ibd4cd95daab7efff947273ca9e7d457de0286f47 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "languageclient_global.h"
|
||||
|
||||
#include <languageserverprotocol/basemessage.h>
|
||||
#include <languageserverprotocol/jsonrpcmessages.h>
|
||||
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
@@ -45,19 +45,20 @@ public:
|
||||
|
||||
~BaseClientInterface() override;
|
||||
|
||||
void sendMessage(const LanguageServerProtocol::BaseMessage &message);
|
||||
void sendContent(const LanguageServerProtocol::IContent &content);
|
||||
virtual bool start() { return true; }
|
||||
|
||||
void resetBuffer();
|
||||
|
||||
signals:
|
||||
void messageReceived(LanguageServerProtocol::BaseMessage message);
|
||||
void contentReceived(const LanguageServerProtocol::JsonRpcMessage message);
|
||||
void finished();
|
||||
void error(const QString &message);
|
||||
|
||||
protected:
|
||||
virtual void sendData(const QByteArray &data) = 0;
|
||||
void parseData(const QByteArray &data);
|
||||
virtual void parseCurrentMessage();
|
||||
|
||||
private:
|
||||
QBuffer m_buffer;
|
||||
|
||||
Reference in New Issue
Block a user