Switch to {Request,Notification}Message

This commit is contained in:
Fangrui Song 2018-01-19 01:01:56 -08:00
parent 0e2b2cfb0c
commit 58aa00e6c8
14 changed files with 19 additions and 33 deletions

View File

@ -3,9 +3,8 @@
#include "queue_manager.h"
namespace {
struct Ipc_CqueryBase : public IpcMessage<Ipc_CqueryBase> {
struct Ipc_CqueryBase : public RequestMessage<Ipc_CqueryBase> {
const static IpcId kIpcId = IpcId::CqueryBase;
lsRequestId id;
lsTextDocumentPositionParams params;
};
MAKE_REFLECT_STRUCT(Ipc_CqueryBase, id, params);

View File

@ -7,20 +7,18 @@
// FIXME Interop with VSCode, change std::string usr to Usr (uint64_t)
namespace {
struct Ipc_CqueryCallTreeInitial
: public IpcMessage<Ipc_CqueryCallTreeInitial> {
: public RequestMessage<Ipc_CqueryCallTreeInitial> {
const static IpcId kIpcId = IpcId::CqueryCallTreeInitial;
lsRequestId id;
lsTextDocumentPositionParams params;
};
MAKE_REFLECT_STRUCT(Ipc_CqueryCallTreeInitial, id, params);
REGISTER_IPC_MESSAGE(Ipc_CqueryCallTreeInitial);
struct Ipc_CqueryCallTreeExpand : public IpcMessage<Ipc_CqueryCallTreeExpand> {
struct Ipc_CqueryCallTreeExpand : public RequestMessage<Ipc_CqueryCallTreeExpand> {
const static IpcId kIpcId = IpcId::CqueryCallTreeExpand;
struct Params {
std::string usr;
};
const static IpcId kIpcId = IpcId::CqueryCallTreeExpand;
lsRequestId id;
Params params;
};
MAKE_REFLECT_STRUCT(Ipc_CqueryCallTreeExpand::Params, usr);

View File

@ -3,9 +3,8 @@
#include "queue_manager.h"
namespace {
struct Ipc_CqueryCallers : public IpcMessage<Ipc_CqueryCallers> {
struct Ipc_CqueryCallers : public RequestMessage<Ipc_CqueryCallers> {
const static IpcId kIpcId = IpcId::CqueryCallers;
lsRequestId id;
lsTextDocumentPositionParams params;
};
MAKE_REFLECT_STRUCT(Ipc_CqueryCallers, id, params);

View File

@ -3,9 +3,8 @@
#include "queue_manager.h"
namespace {
struct Ipc_CqueryDerived : public IpcMessage<Ipc_CqueryDerived> {
struct Ipc_CqueryDerived : public RequestMessage<Ipc_CqueryDerived> {
const static IpcId kIpcId = IpcId::CqueryDerived;
lsRequestId id;
lsTextDocumentPositionParams params;
};
MAKE_REFLECT_STRUCT(Ipc_CqueryDerived, id, params);

View File

@ -4,12 +4,11 @@
namespace {
struct Ipc_CqueryTextDocumentDidView
: public IpcMessage<Ipc_CqueryTextDocumentDidView> {
: public NotificationMessage<Ipc_CqueryTextDocumentDidView> {
const static IpcId kIpcId = IpcId::CqueryTextDocumentDidView;
struct Params {
lsDocumentUri textDocumentUri;
};
const static IpcId kIpcId = IpcId::CqueryTextDocumentDidView;
Params params;
};
MAKE_REFLECT_STRUCT(Ipc_CqueryTextDocumentDidView::Params, textDocumentUri);

View File

@ -9,9 +9,9 @@
#include <loguru.hpp>
namespace {
struct Ipc_CqueryFreshenIndex : public IpcMessage<Ipc_CqueryFreshenIndex> {
struct Ipc_CqueryFreshenIndex : public RequestMessage<Ipc_CqueryFreshenIndex> {
const static IpcId kIpcId = IpcId::CqueryFreshenIndex;
lsRequestId id;
// FIXME fresh partial files
};
MAKE_REFLECT_STRUCT(Ipc_CqueryFreshenIndex, id);
REGISTER_IPC_MESSAGE(Ipc_CqueryFreshenIndex);

View File

@ -5,9 +5,8 @@
#include <loguru/loguru.hpp>
namespace {
struct Ipc_CqueryIndexFile : public IpcMessage<Ipc_CqueryIndexFile> {
struct Ipc_CqueryIndexFile : public NotificationMessage<Ipc_CqueryIndexFile> {
static constexpr IpcId kIpcId = IpcId::CqueryIndexFile;
struct Params {
std::string path;
std::vector<std::string> args;

View File

@ -4,18 +4,16 @@
namespace {
struct Ipc_CqueryMemberHierarchyInitial
: public IpcMessage<Ipc_CqueryMemberHierarchyInitial> {
: public RequestMessage<Ipc_CqueryMemberHierarchyInitial> {
const static IpcId kIpcId = IpcId::CqueryMemberHierarchyInitial;
lsRequestId id;
lsTextDocumentPositionParams params;
};
MAKE_REFLECT_STRUCT(Ipc_CqueryMemberHierarchyInitial, id, params);
REGISTER_IPC_MESSAGE(Ipc_CqueryMemberHierarchyInitial);
struct Ipc_CqueryMemberHierarchyExpand
: public IpcMessage<Ipc_CqueryMemberHierarchyExpand> {
: public RequestMessage<Ipc_CqueryMemberHierarchyExpand> {
const static IpcId kIpcId = IpcId::CqueryMemberHierarchyExpand;
lsRequestId id;
struct Params {
size_t type_id;
};

View File

@ -4,9 +4,8 @@
namespace {
struct Ipc_CqueryTypeHierarchyTree
: public IpcMessage<Ipc_CqueryTypeHierarchyTree> {
: public RequestMessage<Ipc_CqueryTypeHierarchyTree> {
const static IpcId kIpcId = IpcId::CqueryTypeHierarchyTree;
lsRequestId id;
lsTextDocumentPositionParams params;
};
MAKE_REFLECT_STRUCT(Ipc_CqueryTypeHierarchyTree, id, params);

View File

@ -3,9 +3,8 @@
#include "queue_manager.h"
namespace {
struct Ipc_CqueryVars : public IpcMessage<Ipc_CqueryVars> {
struct Ipc_CqueryVars : public RequestMessage<Ipc_CqueryVars> {
const static IpcId kIpcId = IpcId::CqueryVars;
lsRequestId id;
lsTextDocumentPositionParams params;
};
MAKE_REFLECT_STRUCT(Ipc_CqueryVars, id, params);

View File

@ -6,7 +6,7 @@
#include <loguru.hpp>
namespace {
struct Ipc_CqueryWait : public IpcMessage<Ipc_CqueryWait> {
struct Ipc_CqueryWait : public NotificationMessage<Ipc_CqueryWait> {
static constexpr IpcId kIpcId = IpcId::CqueryWait;
};
MAKE_REFLECT_EMPTY_STRUCT(Ipc_CqueryWait);

View File

@ -3,7 +3,7 @@
#include <loguru.hpp>
namespace {
struct Ipc_Exit : public IpcMessage<Ipc_Exit> {
struct Ipc_Exit : public NotificationMessage<Ipc_Exit> {
static const IpcId kIpcId = IpcId::Exit;
};
MAKE_REFLECT_EMPTY_STRUCT(Ipc_Exit);

View File

@ -17,10 +17,8 @@ extern std::string g_init_options;
extern int g_enable_comments;
namespace {
struct Ipc_InitializeRequest : public IpcMessage<Ipc_InitializeRequest> {
struct Ipc_InitializeRequest : public RequestMessage<Ipc_InitializeRequest> {
const static IpcId kIpcId = IpcId::Initialize;
lsRequestId id;
lsInitializeParams params;
};
MAKE_REFLECT_STRUCT(Ipc_InitializeRequest, id, params);

View File

@ -2,9 +2,8 @@
#include "queue_manager.h"
namespace {
struct Ipc_Shutdown : public IpcMessage<Ipc_Shutdown> {
struct Ipc_Shutdown : public RequestMessage<Ipc_Shutdown> {
static const IpcId kIpcId = IpcId::Shutdown;
lsRequestId id;
};
MAKE_REFLECT_STRUCT(Ipc_Shutdown, id);
REGISTER_IPC_MESSAGE(Ipc_Shutdown);