Move initialization Ipc structures into messages/

This commit is contained in:
Jacob Dufault 2017-12-05 20:08:55 -08:00
parent ad550f3f2c
commit 5093863b33
3 changed files with 28 additions and 28 deletions

View File

@ -86,8 +86,6 @@ void EmitDiagnostics(WorkingFiles* working_files,
}
REGISTER_IPC_MESSAGE(Ipc_CancelRequest);
REGISTER_IPC_MESSAGE(Ipc_InitializeRequest);
REGISTER_IPC_MESSAGE(Ipc_InitializedNotification);
REGISTER_IPC_MESSAGE(Ipc_Exit);
REGISTER_IPC_MESSAGE(Ipc_TextDocumentDidOpen);
REGISTER_IPC_MESSAGE(Ipc_CqueryTextDocumentDidView);

View File

@ -899,32 +899,6 @@ MAKE_REFLECT_STRUCT(lsServerCapabilities,
documentLinkProvider,
executeCommandProvider);
struct Ipc_InitializeRequest : public IpcMessage<Ipc_InitializeRequest> {
const static IpcId kIpcId = IpcId::Initialize;
lsRequestId id;
lsInitializeParams params;
};
MAKE_REFLECT_STRUCT(Ipc_InitializeRequest, id, params);
struct Out_InitializeResponse : public lsOutMessage<Out_InitializeResponse> {
struct InitializeResult {
lsServerCapabilities capabilities;
};
lsRequestId id;
InitializeResult result;
};
MAKE_REFLECT_STRUCT(Out_InitializeResponse::InitializeResult, capabilities);
MAKE_REFLECT_STRUCT(Out_InitializeResponse, jsonrpc, id, result);
struct Ipc_InitializedNotification
: public IpcMessage<Ipc_InitializedNotification> {
const static IpcId kIpcId = IpcId::Initialized;
lsRequestId id;
};
MAKE_REFLECT_STRUCT(Ipc_InitializedNotification, id);
struct Ipc_Exit : public IpcMessage<Ipc_Exit> {
static const IpcId kIpcId = IpcId::Exit;
};

View File

@ -5,6 +5,34 @@
#include <loguru.hpp>
struct Ipc_InitializeRequest : public IpcMessage<Ipc_InitializeRequest> {
const static IpcId kIpcId = IpcId::Initialize;
lsRequestId id;
lsInitializeParams params;
};
MAKE_REFLECT_STRUCT(Ipc_InitializeRequest, id, params);
REGISTER_IPC_MESSAGE(Ipc_InitializeRequest);
struct Out_InitializeResponse : public lsOutMessage<Out_InitializeResponse> {
struct InitializeResult {
lsServerCapabilities capabilities;
};
lsRequestId id;
InitializeResult result;
};
MAKE_REFLECT_STRUCT(Out_InitializeResponse::InitializeResult, capabilities);
MAKE_REFLECT_STRUCT(Out_InitializeResponse, jsonrpc, id, result);
struct Ipc_InitializedNotification
: public IpcMessage<Ipc_InitializedNotification> {
const static IpcId kIpcId = IpcId::Initialized;
lsRequestId id;
};
MAKE_REFLECT_STRUCT(Ipc_InitializedNotification, id);
REGISTER_IPC_MESSAGE(Ipc_InitializedNotification);
struct InitializeHandler : BaseMessageHandler<Ipc_InitializeRequest> {
void Run(Ipc_InitializeRequest* request) override {
// Log initialization parameters.