ccls/src/ipc.cc
Jacob Dufault c7e5299bee Reformat
2018-03-19 19:51:42 -07:00

34 lines
673 B
C++

#include "ipc.h"
#include <cassert>
const char* IpcIdToString(IpcId id) {
switch (id) {
case IpcId::CancelRequest:
return "$/cancelRequest";
case IpcId::Initialized:
return "initialized";
case IpcId::Exit:
return "exit";
#define CASE(name, method) \
case IpcId::name: \
return method;
#include "methods.inc"
#undef CASE
case IpcId::Unknown:
return "$unknown";
}
CQUERY_UNREACHABLE("missing IpcId string name");
}
BaseIpcMessage::BaseIpcMessage(IpcId method_id) : method_id(method_id) {}
BaseIpcMessage::~BaseIpcMessage() = default;
lsRequestId BaseIpcMessage::GetRequestId() {
return std::monostate();
}