2017-03-25 23:58:11 +00:00
|
|
|
#include "ipc.h"
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
const char* IpcIdToString(IpcId id) {
|
|
|
|
switch (id) {
|
2017-09-22 01:14:57 +00:00
|
|
|
case IpcId::CancelRequest:
|
|
|
|
return "$/cancelRequest";
|
|
|
|
case IpcId::Initialize:
|
|
|
|
return "initialize";
|
|
|
|
case IpcId::Initialized:
|
|
|
|
return "initialized";
|
2018-01-09 08:20:51 +00:00
|
|
|
case IpcId::Shutdown:
|
|
|
|
return "shutdown";
|
2017-09-22 01:14:57 +00:00
|
|
|
case IpcId::Exit:
|
|
|
|
return "exit";
|
|
|
|
case IpcId::TextDocumentDidOpen:
|
|
|
|
return "textDocument/didOpen";
|
|
|
|
case IpcId::TextDocumentDidChange:
|
|
|
|
return "textDocument/didChange";
|
|
|
|
case IpcId::TextDocumentDidClose:
|
|
|
|
return "textDocument/didClose";
|
|
|
|
case IpcId::TextDocumentDidSave:
|
|
|
|
return "textDocument/didSave";
|
|
|
|
case IpcId::TextDocumentPublishDiagnostics:
|
|
|
|
return "textDocument/publishDiagnostics";
|
|
|
|
case IpcId::TextDocumentRename:
|
|
|
|
return "textDocument/rename";
|
|
|
|
case IpcId::TextDocumentCompletion:
|
|
|
|
return "textDocument/completion";
|
|
|
|
case IpcId::TextDocumentSignatureHelp:
|
|
|
|
return "textDocument/signatureHelp";
|
|
|
|
case IpcId::TextDocumentDefinition:
|
|
|
|
return "textDocument/definition";
|
|
|
|
case IpcId::TextDocumentDocumentHighlight:
|
|
|
|
return "textDocument/documentHighlight";
|
|
|
|
case IpcId::TextDocumentHover:
|
|
|
|
return "textDocument/hover";
|
2017-12-25 13:08:36 +00:00
|
|
|
case IpcId::TextDocumentFormatting:
|
|
|
|
return "textDocument/formatting";
|
2017-12-31 22:52:06 +00:00
|
|
|
case IpcId::TextDocumentRangeFormatting:
|
|
|
|
return "textDocument/rangeFormatting";
|
|
|
|
case IpcId::TextDocumentOnTypeFormatting:
|
|
|
|
return "textDocument/onTypeFormatting";
|
2017-09-22 01:14:57 +00:00
|
|
|
case IpcId::TextDocumentReferences:
|
|
|
|
return "textDocument/references";
|
|
|
|
case IpcId::TextDocumentDocumentSymbol:
|
|
|
|
return "textDocument/documentSymbol";
|
|
|
|
case IpcId::TextDocumentDocumentLink:
|
|
|
|
return "textDocument/documentLink";
|
|
|
|
case IpcId::TextDocumentCodeAction:
|
|
|
|
return "textDocument/codeAction";
|
|
|
|
case IpcId::TextDocumentCodeLens:
|
|
|
|
return "textDocument/codeLens";
|
|
|
|
case IpcId::CodeLensResolve:
|
|
|
|
return "codeLens/resolve";
|
|
|
|
case IpcId::WorkspaceSymbol:
|
|
|
|
return "workspace/symbol";
|
2017-04-16 21:49:48 +00:00
|
|
|
|
2017-12-03 22:35:22 +00:00
|
|
|
case IpcId::CqueryTextDocumentDidView:
|
|
|
|
return "$cquery/textDocumentDidView";
|
2017-09-22 01:14:57 +00:00
|
|
|
case IpcId::CqueryPublishInactiveRegions:
|
|
|
|
return "$cquery/publishInactiveRegions";
|
2017-11-09 07:06:32 +00:00
|
|
|
case IpcId::CqueryPublishSemanticHighlighting:
|
|
|
|
return "$cquery/publishSemanticHighlighting";
|
2017-05-20 21:45:46 +00:00
|
|
|
|
2017-09-22 01:14:57 +00:00
|
|
|
case IpcId::CqueryFreshenIndex:
|
|
|
|
return "$cquery/freshenIndex";
|
|
|
|
case IpcId::CqueryTypeHierarchyTree:
|
|
|
|
return "$cquery/typeHierarchyTree";
|
|
|
|
case IpcId::CqueryCallTreeInitial:
|
|
|
|
return "$cquery/callTreeInitial";
|
|
|
|
case IpcId::CqueryCallTreeExpand:
|
|
|
|
return "$cquery/callTreeExpand";
|
|
|
|
case IpcId::CqueryVars:
|
|
|
|
return "$cquery/vars";
|
|
|
|
case IpcId::CqueryCallers:
|
|
|
|
return "$cquery/callers";
|
|
|
|
case IpcId::CqueryBase:
|
|
|
|
return "$cquery/base";
|
|
|
|
case IpcId::CqueryDerived:
|
|
|
|
return "$cquery/derived";
|
2017-04-16 21:49:48 +00:00
|
|
|
|
2017-12-04 08:16:19 +00:00
|
|
|
case IpcId::Unknown:
|
|
|
|
return "$unknown";
|
2017-09-13 03:35:27 +00:00
|
|
|
|
2017-09-22 01:14:57 +00:00
|
|
|
case IpcId::CqueryIndexFile:
|
|
|
|
return "$cquery/indexFile";
|
2017-12-28 16:55:46 +00:00
|
|
|
case IpcId::CqueryWait:
|
|
|
|
return "$cquery/wait";
|
2017-09-13 03:35:27 +00:00
|
|
|
|
2017-09-22 01:14:57 +00:00
|
|
|
default:
|
|
|
|
assert(false && "missing IpcId string name");
|
|
|
|
exit(1);
|
2017-03-25 23:58:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-22 01:14:57 +00:00
|
|
|
BaseIpcMessage::BaseIpcMessage(IpcId method_id) : method_id(method_id) {}
|
2017-06-09 06:20:29 +00:00
|
|
|
|
2017-12-25 13:08:36 +00:00
|
|
|
BaseIpcMessage::~BaseIpcMessage() = default;
|