nixd
|
Namespaces | |
namespace | idioms |
namespace | rpc |
namespace | rpcMethod |
namespace | util |
Classes | |
struct | AttrPathCompleteParams |
struct | AttrPathInfoResponse |
class | AttrSetClient |
class | AttrSetClientProc |
class | AttrSetProvider |
Main RPC class for attrset provider. More... | |
struct | CannotFindVarException |
struct | Configuration |
class | Controller |
class | EvalClient |
class | EvalProvider |
class | JSONParseException |
class | JSONSchemaException |
class | LLVMErrorException |
class | NixTU |
Holds analyzed information about a document. More... | |
struct | OptionDescription |
struct | OptionField |
struct | OptionType |
class | OwnedEvalClient |
struct | PackageDescription |
struct | StreamProc |
struct | ValueMeta |
General metadata of all nix::Value s. More... | |
Typedefs | |
using | EvalExprParams = std::string |
using | EvalExprResponse = std::optional<std::string> |
using | Selector = std::vector<std::string> |
A list of strings that "select"s into a attribute set. | |
using | PackageInfoParams = Selector |
using | OptionInfoParams = Selector |
using | AttrPathInfoParams = Selector |
using | AttrPathCompleteResponse = std::vector<std::string> |
using | OptionInfoResponse = OptionDescription |
using | OptionCompleteResponse = std::vector<OptionField> |
Enumerations | |
enum class | FindAttrPathResult { OK , Inherit , NotAttrPath , WithDynamic } |
Functions | |
nixd::Configuration | parseCLIConfig () |
Parse the CLI flag and initialize the config nixd::DefaultConfig. | |
bool | fromJSON (const llvm::json::Value &Params, Configuration::Diagnostic &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, Configuration::Formatting &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, Configuration::OptionProvider &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, Configuration::NixpkgsProvider &R, llvm::json::Path P) |
bool | fromJSON (const llvm::json::Value &Params, Configuration &R, llvm::json::Path P) |
void | startAttrSetEval (const std::string &Name, std::unique_ptr< AttrSetClientProc > &Worker) |
void | startNixpkgs (std::unique_ptr< AttrSetClientProc > &NixpkgsEval) |
void | startOption (const std::string &Name, std::unique_ptr< AttrSetClientProc > &Worker) |
llvm::json::Value | toJSON (const PackageDescription &Params) |
bool | fromJSON (const llvm::json::Value &Params, PackageDescription &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const ValueMeta &Params) |
bool | fromJSON (const llvm::json::Value &Params, ValueMeta &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const AttrPathInfoResponse &Params) |
bool | fromJSON (const llvm::json::Value &Params, AttrPathInfoResponse &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const AttrPathCompleteParams &Params) |
bool | fromJSON (const llvm::json::Value &Params, AttrPathCompleteParams &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const OptionType &Params) |
bool | fromJSON (const llvm::json::Value &Params, OptionType &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const OptionDescription &Params) |
bool | fromJSON (const llvm::json::Value &Params, OptionDescription &R, llvm::json::Path P) |
llvm::json::Value | toJSON (const OptionField &Params) |
bool | fromJSON (const llvm::json::Value &Params, OptionField &R, llvm::json::Path P) |
int | forkPiped (int &In, int &Out, int &Err) |
fork this process and create some pipes connected to the new process. | |
llvm::json::Value | parse (llvm::StringRef JSON) |
template<class T > | |
T | fromJSON (const llvm::json::Value &V) |
const nixf::EnvNode * | upEnv (const nixf::Node &Desc, const nixf::VariableLookupAnalysis &VLA, const nixf::ParentMapAnalysis &PM) |
Search up until there are some node associated with "EnvNode". | |
bool | havePackageScope (const nixf::Node &N, const nixf::VariableLookupAnalysis &VLA, const nixf::ParentMapAnalysis &PM) |
Determine whether or not some node has enclosed "with pkgs; [ ]". | |
std::pair< std::vector< std::string >, std::string > | getScopeAndPrefix (const nixf::Node &N, const nixf::ParentMapAnalysis &PM) |
get variable scope, and it's prefix name. | |
FindAttrPathResult | findAttrPath (const nixf::Node &N, const nixf::ParentMapAnalysis &PM, std::vector< std::string > &Path) |
Heuristically find attrpath suitable for "attrpath" completion. | |
lspserver::Position | toLSPPosition (llvm::StringRef Code, const nixf::LexerCursor &P) |
nixf::Position | toNixfPosition (const lspserver::Position &P) |
nixf::PositionRange | toNixfRange (const lspserver::Range &P) |
lspserver::Range | toLSPRange (llvm::StringRef Code, const nixf::LexerCursorRange &R) |
int | getLSPSeverity (nixf::Diagnostic::DiagnosticKind Kind) |
llvm::SmallVector< lspserver::DiagnosticTag, 1 > | toLSPTags (const std::vector< nixf::DiagnosticTag > &Tags) |
const nixf::Definition & | findDefinition (const nixf::Node &N, const nixf::ParentMapAnalysis &PMA, const nixf::VariableLookupAnalysis &VLA) |
Heuristically find definition on some node. | |
Variables | |
llvm::cl::OptionCategory | NixdCategory |
llvm::cl::opt< bool > | LitTest |
Indicating that we are in lit-test mode. | |
using nixd::AttrPathCompleteResponse = std::vector<std::string> |
using nixd::AttrPathInfoParams = Selector |
using nixd::EvalExprParams = std::string |
using nixd::EvalExprResponse = std::optional<std::string> |
using nixd::OptionCompleteResponse = std::vector<OptionField> |
using nixd::OptionInfoParams = Selector |
using nixd::PackageInfoParams = Selector |
using nixd::Selector = std::vector<std::string> |
|
strong |
nixd::FindAttrPathResult nixd::findAttrPath | ( | const nixf::Node & | N, |
const nixf::ParentMapAnalysis & | PM, | ||
std::vector< std::string > & | Path ) |
Heuristically find attrpath suitable for "attrpath" completion.
[out] | Path | the attrpath. |
Definition at line 283 of file AST.cpp.
References nixf::ParentMapAnalysis::upTo().
const Definition & nixd::findDefinition | ( | const nixf::Node & | N, |
const nixf::ParentMapAnalysis & | PMA, | ||
const nixf::VariableLookupAnalysis & | VLA ) |
Heuristically find definition on some node.
Definition at line 345 of file Definition.cpp.
References nixf::Node::kind().
int nixd::forkPiped | ( | int & | In, |
int & | Out, | ||
int & | Err ) |
fork this process and create some pipes connected to the new process.
stdin, stdout, stderr in the new process will be closed, and these fds could be used to communicate with it.
Definition at line 8 of file ForkPiped.cpp.
Referenced by nixd::StreamProc::StreamProc().
bool nixd::fromJSON | ( | const llvm::json::Value & | Params, |
AttrPathCompleteParams & | R, | ||
llvm::json::Path | P ) |
Definition at line 115 of file AttrSet.cpp.
References nixd::AttrPathCompleteParams::Prefix, and nixd::AttrPathCompleteParams::Scope.
bool nixd::fromJSON | ( | const llvm::json::Value & | Params, |
AttrPathInfoResponse & | R, | ||
llvm::json::Path | P ) |
Definition at line 103 of file AttrSet.cpp.
References nixd::AttrPathInfoResponse::Meta, and nixd::AttrPathInfoResponse::PackageDesc.
bool nixd::fromJSON | ( | const llvm::json::Value & | Params, |
Configuration & | R, | ||
llvm::json::Path | P ) |
bool nixd::fromJSON | ( | const llvm::json::Value & | Params, |
Configuration::Diagnostic & | R, | ||
llvm::json::Path | P ) |
Referenced by fromJSON(), and parseCLIConfig().
bool nixd::fromJSON | ( | const llvm::json::Value & | Params, |
Configuration::Formatting & | R, | ||
llvm::json::Path | P ) |
bool nixd::fromJSON | ( | const llvm::json::Value & | Params, |
Configuration::NixpkgsProvider & | R, | ||
llvm::json::Path | P ) |
bool nixd::fromJSON | ( | const llvm::json::Value & | Params, |
Configuration::OptionProvider & | R, | ||
llvm::json::Path | P ) |
bool nixd::fromJSON | ( | const llvm::json::Value & | Params, |
OptionDescription & | R, | ||
llvm::json::Path | P ) |
bool nixd::fromJSON | ( | const llvm::json::Value & | Params, |
OptionField & | R, | ||
llvm::json::Path | P ) |
bool nixd::fromJSON | ( | const llvm::json::Value & | Params, |
OptionType & | R, | ||
llvm::json::Path | P ) |
bool nixd::fromJSON | ( | const llvm::json::Value & | Params, |
PackageDescription & | R, | ||
llvm::json::Path | P ) |
Definition at line 66 of file AttrSet.cpp.
References nixd::PackageDescription::Description, nixd::PackageDescription::Homepage, nixd::PackageDescription::LongDescription, nixd::PackageDescription::Name, nixd::PackageDescription::PName, nixd::PackageDescription::Position, and nixd::PackageDescription::Version.
bool nixd::fromJSON | ( | const llvm::json::Value & | Params, |
ValueMeta & | R, | ||
llvm::json::Path | P ) |
Definition at line 87 of file AttrSet.cpp.
References nixd::ValueMeta::Location, and nixd::ValueMeta::Type.
T nixd::fromJSON | ( | const llvm::json::Value & | V | ) |
Definition at line 32 of file JSON.h.
References fromJSON().
int nixd::getLSPSeverity | ( | nixf::Diagnostic::DiagnosticKind | Kind | ) |
Definition at line 11 of file Convert.cpp.
References nixf::Diagnostic::DS_Error, nixf::Diagnostic::DS_Fatal, nixf::Diagnostic::DS_Hint, nixf::Diagnostic::DS_Info, nixf::Diagnostic::DS_Warning, and nixf::Diagnostic::severity().
std::pair< std::vector< std::string >, std::string > nixd::getScopeAndPrefix | ( | const nixf::Node & | N, |
const nixf::ParentMapAnalysis & | PM ) |
get variable scope, and it's prefix name.
Nixpkgs has some packages scoped in "nested" attrs. e.g. llvmPackages, pythonPackages. Try to find these name as a pre-selected scope, the last value is "prefix".
Definition at line 274 of file AST.cpp.
References nixf::Node::kind().
|
nodiscard |
Determine whether or not some node has enclosed "with pkgs; [ ]".
Yes, this evaluation isn't flawless. What if the identifier isn't "pkgs"? We can't dynamically evaluate everything each time and invalidate them immediately after document updates. Therefore, this heuristic method represents a trade-off between performance considerations.
Definition at line 108 of file AST.cpp.
References nixf::ExprVar::id(), nixf::EnvNode::isWith(), nixf::Node::kind(), nixf::Identifier::name(), nixf::EnvNode::parent(), nixf::EnvNode::syntax(), upEnv(), and nixf::ExprWith::with().
llvm::json::Value nixd::parse | ( | llvm::StringRef | JSON | ) |
Definition at line 5 of file JSON.cpp.
Referenced by parseCLIConfig().
Configuration nixd::parseCLIConfig | ( | ) |
Parse the CLI flag and initialize the config nixd::DefaultConfig.
Definition at line 27 of file CommandLine/Configuration.cpp.
References fromJSON(), and parse().
void nixd::startAttrSetEval | ( | const std::string & | Name, |
std::unique_ptr< AttrSetClientProc > & | Worker ) |
Definition at line 24 of file Launch.cpp.
References nixd::AttrSetClient::getExe().
Referenced by startNixpkgs(), and startOption().
void nixd::startNixpkgs | ( | std::unique_ptr< AttrSetClientProc > & | NixpkgsEval | ) |
Definition at line 32 of file Launch.cpp.
References startAttrSetEval().
void nixd::startOption | ( | const std::string & | Name, |
std::unique_ptr< AttrSetClientProc > & | Worker ) |
Definition at line 36 of file Launch.cpp.
References NULL_DEVICE, and startAttrSetEval().
Value nixd::toJSON | ( | const AttrPathCompleteParams & | Params | ) |
Definition at line 112 of file AttrSet.cpp.
References lspserver::Object, nixd::AttrPathCompleteParams::Prefix, and nixd::AttrPathCompleteParams::Scope.
Value nixd::toJSON | ( | const AttrPathInfoResponse & | Params | ) |
Definition at line 96 of file AttrSet.cpp.
References nixd::AttrPathInfoResponse::Meta, lspserver::Object, and nixd::AttrPathInfoResponse::PackageDesc.
Value nixd::toJSON | ( | const OptionDescription & | Params | ) |
Definition at line 20 of file AttrSet.cpp.
References nixd::OptionDescription::Declarations, nixd::OptionDescription::Definitions, nixd::OptionDescription::Description, nixd::OptionDescription::Example, lspserver::Object, and nixd::OptionDescription::Type.
Value nixd::toJSON | ( | const OptionField & | Params | ) |
Definition at line 40 of file AttrSet.cpp.
References nixd::OptionField::Description, nixd::OptionField::Name, and lspserver::Object.
Value nixd::toJSON | ( | const OptionType & | Params | ) |
Definition at line 6 of file AttrSet.cpp.
References nixd::OptionType::Description, nixd::OptionType::Name, and lspserver::Object.
Value nixd::toJSON | ( | const PackageDescription & | Params | ) |
Definition at line 54 of file AttrSet.cpp.
References nixd::PackageDescription::Description, nixd::PackageDescription::Homepage, nixd::PackageDescription::LongDescription, nixd::PackageDescription::Name, lspserver::Object, nixd::PackageDescription::PName, nixd::PackageDescription::Position, and nixd::PackageDescription::Version.
Definition at line 80 of file AttrSet.cpp.
References nixd::ValueMeta::Location, lspserver::Object, and nixd::ValueMeta::Type.
lspserver::Position nixd::toLSPPosition | ( | llvm::StringRef | Code, |
const nixf::LexerCursor & | P ) |
Definition at line 27 of file Convert.cpp.
References nixf::LexerCursor::offset(), and lspserver::offsetToPosition().
Referenced by toLSPRange().
lspserver::Range nixd::toLSPRange | ( | llvm::StringRef | Code, |
const nixf::LexerCursorRange & | R ) |
Definition at line 40 of file Convert.cpp.
References nixf::LexerCursorRange::lCur(), nixf::LexerCursorRange::rCur(), and toLSPPosition().
llvm::SmallVector< lspserver::DiagnosticTag, 1 > nixd::toLSPTags | ( | const std::vector< nixf::DiagnosticTag > & | Tags | ) |
Definition at line 47 of file Convert.cpp.
References nixf::Faded, and nixf::Striked.
nixf::Position nixd::toNixfPosition | ( | const lspserver::Position & | P | ) |
Definition at line 32 of file Convert.cpp.
References lspserver::Position::character, and lspserver::Position::line.
Referenced by toNixfRange().
nixf::PositionRange nixd::toNixfRange | ( | const lspserver::Range & | P | ) |
Definition at line 36 of file Convert.cpp.
References lspserver::Range::end, lspserver::Range::start, and toNixfPosition().
|
nodiscard |
Search up until there are some node associated with "EnvNode".
Definition at line 98 of file AST.cpp.
References nixf::VariableLookupAnalysis::env(), nixf::ParentMapAnalysis::isRoot(), and nixf::ParentMapAnalysis::query().
Referenced by havePackageScope().
|
extern |
Indicating that we are in lit-test mode.
Definition at line 8 of file Options.cpp.
|
extern |