2017-03-25 23:58:11 +00:00
|
|
|
#include "ipc.h"
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
const char* IpcIdToString(IpcId id) {
|
|
|
|
switch (id) {
|
|
|
|
case IpcId::CancelRequest:
|
|
|
|
return "$/cancelRequest";
|
|
|
|
case IpcId::Initialize:
|
|
|
|
return "initialize";
|
|
|
|
case IpcId::Initialized:
|
|
|
|
return "initialized";
|
2017-03-26 06:47:59 +00:00
|
|
|
case IpcId::TextDocumentDidOpen:
|
|
|
|
return "textDocument/didOpen";
|
|
|
|
case IpcId::TextDocumentDidChange:
|
|
|
|
return "textDocument/didChange";
|
|
|
|
case IpcId::TextDocumentDidClose:
|
|
|
|
return "textDocument/didClose";
|
2017-04-10 00:08:54 +00:00
|
|
|
case IpcId::TextDocumentDidSave:
|
|
|
|
return "textDocument/didSave";
|
2017-04-14 08:21:03 +00:00
|
|
|
case IpcId::TextDocumentRename:
|
|
|
|
return "textDocument/rename";
|
2017-03-26 06:47:59 +00:00
|
|
|
case IpcId::TextDocumentCompletion:
|
|
|
|
return "textDocument/completion";
|
2017-04-03 02:21:21 +00:00
|
|
|
case IpcId::TextDocumentDefinition:
|
|
|
|
return "textDocument/definition";
|
2017-04-14 06:43:50 +00:00
|
|
|
case IpcId::TextDocumentDocumentHighlight:
|
|
|
|
return "textDocument/documentHighlight";
|
2017-04-14 05:18:02 +00:00
|
|
|
case IpcId::TextDocumentHover:
|
|
|
|
return "textDocument/hover";
|
2017-04-10 05:34:06 +00:00
|
|
|
case IpcId::TextDocumentReferences:
|
|
|
|
return "textDocument/references";
|
2017-03-25 23:58:11 +00:00
|
|
|
case IpcId::TextDocumentDocumentSymbol:
|
|
|
|
return "textDocument/documentSymbol";
|
|
|
|
case IpcId::TextDocumentCodeLens:
|
|
|
|
return "textDocument/codeLens";
|
|
|
|
case IpcId::CodeLensResolve:
|
|
|
|
return "codeLens/resolve";
|
|
|
|
case IpcId::WorkspaceSymbol:
|
|
|
|
return "workspace/symbol";
|
|
|
|
default:
|
|
|
|
assert(false);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BaseIpcMessage::BaseIpcMessage(IpcId method_id)
|
|
|
|
: method_id(method_id) {}
|