nixd
Loading...
Searching...
No Matches
CommandLine/Configuration.cpp
Go to the documentation of this file.
1/// \file
2/// \brief This file implements CLI initialized configuration.
3
7#include "nixd/Support/JSON.h"
8
9#include "lspserver/Logger.h"
10
11#include <llvm/Support/CommandLine.h>
12#include <llvm/Support/JSON.h>
13
14#include <string>
15
16using namespace nixd;
17using namespace llvm::cl;
18
19namespace {
20
21opt<std::string> DefaultConfigJSON{"config",
22 desc("JSON-encoded initial configuration"),
23 init(""), cat(NixdCategory)};
24
25} // namespace
26
28 if (DefaultConfigJSON.empty())
29 return {};
30
32}
Allow default configuration being passed via CLI.
Declares workspace configuration schema.
bool fromJSON(const llvm::json::Value &Params, Configuration::Diagnostic &R, llvm::json::Path P)
llvm::cl::OptionCategory NixdCategory
nixd::Configuration parseCLIConfig()
Parse the CLI flag and initialize the config nixd::DefaultConfig.
llvm::json::Value parse(llvm::StringRef JSON)
Definition JSON.cpp:5