#pragma once #include "utils.h" #include "serializer.h" #include enum class IpcId : int { // Language server specific requests. CancelRequest = 0, Initialize, Initialized, TextDocumentDidOpen, TextDocumentDidChange, TextDocumentDidClose, TextDocumentDidSave, TextDocumentRename, TextDocumentCompletion, TextDocumentDefinition, TextDocumentDocumentHighlight, TextDocumentHover, TextDocumentReferences, TextDocumentDocumentSymbol, TextDocumentCodeLens, CodeLensResolve, WorkspaceSymbol, // Custom messages CqueryFreshenIndex, // Internal implementation detail. Cout }; MAKE_ENUM_HASHABLE(IpcId) MAKE_REFLECT_TYPE_PROXY(IpcId, int) const char* IpcIdToString(IpcId id); struct BaseIpcMessage { const IpcId method_id; BaseIpcMessage(IpcId method_id); }; template struct IpcMessage : public BaseIpcMessage { IpcMessage() : BaseIpcMessage(T::kIpcId) {} }; struct Ipc_Cout : public IpcMessage { static constexpr IpcId kIpcId = IpcId::Cout; std::string content; IpcId original_ipc_id; }; MAKE_REFLECT_STRUCT(Ipc_Cout, content);