mirror of
https://github.com/MaskRay/ccls.git
synced 2024-12-01 20:07:08 +00:00
6c5f1d9c88
It no longer supports multi-process IPC; remove some of the extra code that was used to support that.
31 lines
661 B
C++
31 lines
661 B
C++
#include "ipc_manager.h"
|
|
|
|
#include "language_server_api.h"
|
|
|
|
#include <sstream>
|
|
|
|
IpcManager* IpcManager::instance_ = nullptr;
|
|
|
|
// static
|
|
IpcManager* IpcManager::instance() {
|
|
return instance_;
|
|
}
|
|
|
|
// static
|
|
void IpcManager::CreateInstance(MultiQueueWaiter* waiter) {
|
|
instance_ = new IpcManager(waiter);
|
|
}
|
|
|
|
// static
|
|
void IpcManager::WriteStdout(IpcId id, lsBaseOutMessage& response) {
|
|
std::ostringstream sstream;
|
|
response.Write(sstream);
|
|
|
|
StdoutMessage out;
|
|
out.content = sstream.str();
|
|
out.id = id;
|
|
instance()->for_stdout.Enqueue(std::move(out));
|
|
}
|
|
|
|
IpcManager::IpcManager(MultiQueueWaiter* waiter)
|
|
: for_stdout(waiter), for_querydb(waiter) {} |