mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 23:55:08 +00:00
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
#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";
|
|
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::TextDocumentRename:
|
|
return "textDocument/rename";
|
|
case IpcId::TextDocumentCompletion:
|
|
return "textDocument/completion";
|
|
case IpcId::TextDocumentDefinition:
|
|
return "textDocument/definition";
|
|
case IpcId::TextDocumentDocumentHighlight:
|
|
return "textDocument/documentHighlight";
|
|
case IpcId::TextDocumentHover:
|
|
return "textDocument/hover";
|
|
case IpcId::TextDocumentReferences:
|
|
return "textDocument/references";
|
|
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) {}
|