12#include <boost/asio/post.hpp>
22 const std::string &Code = *Store.
getDraft(
File)->Contents;
27 std::lock_guard
G(ConfigLock);
32 Reply(
error(
"formating command is empty, please set external formatter"));
41 Syscall.emplace_back(
const_cast<char *
>(
Str.c_str()));
58 const char *
Start = Code.c_str();
59 const char *End = Code.c_str() + Code.size();
60 while (
Start != End) {
64 throw std::system_error(
errno, std::generic_category());
87 throw std::system_error(
errno, std::generic_category());
93 Reply(std::vector{E});
96 boost::asio::post(Pool, std::move(
Action));
std::optional< Draft > getDraft(PathRef File) const
Whether current platform treats paths case insensitively.
llvm::unique_function< void(llvm::Expected< T >)> Callback
llvm::Error error(std::error_code EC, const char *Fmt, Ts &&...Vals)
constexpr std::string_view Exit
int forkPiped(int &In, int &Out, int &Err)
fork this process and create some pipes connected to the new process.
bool fromJSON(const llvm::json::Value &Params, Configuration::Diagnostic &R, llvm::json::Path P)
struct nixd::Configuration::Formatting formatting