1#include "nixd-config.h"
6#include <llvm/Support/CommandLine.h>
12using namespace llvm::cl;
18OptionCategory Misc(
"miscellaneous options");
19OptionCategory
Debug(
"debug-only options (for developers)");
21opt<JSONStreamStyle> InputStyle{
23 desc(
"Input JSON stream encoding"),
25 clEnumValN(JSONStreamStyle::Standard,
"standard",
"usual LSP protocol"),
26 clEnumValN(JSONStreamStyle::Delimited,
"delimited",
27 "messages delimited by `// -----` lines, "
28 "with // comment support")),
29 init(JSONStreamStyle::Standard),
35 "log", desc(
"Verbosity of log messages written to stderr"),
37 clEnumValN(Logger::Level::Error,
"error",
"Error messages only"),
38 clEnumValN(Logger::Level::Info,
"info",
"High level execution tracing"),
39 clEnumValN(Logger::Level::Debug,
"debug",
"Debugging details"),
40 clEnumValN(Logger::Level::Verbose,
"verbose",
"Low level details")),
41 init(Logger::Level::Info), cat(Misc)};
43opt<bool> PrettyPrint{
"pretty", desc(
"Pretty-print JSON output"), init(
false),
46const OptionCategory *Catogories[] = {&Misc, &
Debug};
50int main(
int Argc,
const char *Argv[]) {
52 SetVersionPrinter([](llvm::raw_ostream &OS) {
53 OS <<
"nixd-attrset-eval, version: ";
62 HideUnrelatedOptions(Catogories);
63 ParseCommandLineOptions(Argc, Argv,
"nixd nixpkgs evaluator",
nullptr,
64 "NIXD_NIXPKGS_EVAL_FLAGS");
67 InputStyle = JSONStreamStyle::Delimited;
68 LogLevel = Logger::Level::Verbose;
76 auto In = std::make_unique<lspserver::InboundPort>(STDIN_FILENO, InputStyle);
78 auto Out = std::make_unique<lspserver::OutboundPort>(PrettyPrint);
Dedicated worker for evaluating attrset.
Interface to allow custom logging in clangd.
Only one LoggingSession can be active at a time.
Main RPC class for attrset provider.
Whether current platform treats paths case insensitively.
llvm::cl::opt< bool > LitTest
Indicating that we are in lit-test mode.
int main(int Argc, const char *Argv[])