nixd
Loading...
Searching...
No Matches
AttrSetClient.cpp
Go to the documentation of this file.
1#include "nixd-config.h"
2
4
5#include <signal.h> // NOLINT(modernize-deprecated-headers)
6
7using namespace nixd;
8using namespace lspserver;
9
25
26const char *AttrSetClient::getExe() {
27 if (const char *Env = std::getenv("NIXD_ATTRSET_EVAL"))
28 return Env;
29 return NIXD_LIBEXEC "/nixd-attrset-eval";
30}
31
32AttrSetClientProc::AttrSetClientProc(const std::function<int()> &Action)
33 : Proc(Action), Client(Proc.mkIn(), Proc.mkOut()),
34 Input([this]() { Client.run(); }) {}
35
37 if (!kill(Proc.proc().PID, 0))
38 return &Client;
39 return nullptr;
40}
AttrSetClient * client()
Check if the process is still alive.
AttrSetClientProc(const std::function< int()> &Action)
static const char * getExe()
AttrSetClient(std::unique_ptr< lspserver::InboundPort > In, std::unique_ptr< lspserver::OutboundPort > Out)
Whether current platform treats paths case insensitively.
Definition Connection.h:11
constexpr std::string_view Exit
Definition AttrSet.h:34
constexpr std::string_view EvalExpr
Definition AttrSet.h:29
constexpr std::string_view OptionInfo
Definition AttrSet.h:32
constexpr std::string_view AttrPathInfo
Definition AttrSet.h:30
constexpr std::string_view OptionComplete
Definition AttrSet.h:33
constexpr std::string_view AttrPathComplete
Definition AttrSet.h:31
bool fromJSON(const llvm::json::Value &Params, Configuration::Diagnostic &R, llvm::json::Path P)
util::PipedProc & proc() const
Definition StreamProc.h:27