nixd
Loading...
Searching...
No Matches
AttrSet.cpp
Go to the documentation of this file.
2
3using namespace nixd;
4using namespace llvm::json;
5
7 return Object{
8 {"Description", Params.Description},
9 {"Name", Params.Name},
10 };
11}
12
13bool nixd::fromJSON(const Value &Params, OptionType &R, Path P) {
14 ObjectMapper O(Params, P);
15 return O //
16 && O.mapOptional("Description", R.Description) //
17 && O.mapOptional("Name", R.Name);
18}
19
21 return Object{
22 {"Description", Params.Description},
23 {"Declarations", Params.Declarations},
24 {"Definitions", Params.Definitions},
25 {"Example", Params.Example},
26 {"Type", Params.Type},
27 };
28}
29bool nixd::fromJSON(const Value &Params, OptionDescription &R, Path P) {
30 ObjectMapper O(Params, P);
31 return O //
32 && O.mapOptional("Description", R.Description) //
33 && O.mapOptional("Declarations", R.Declarations) //
34 && O.mapOptional("Definitions", R.Definitions) //
35 && O.mapOptional("Example", R.Example) //
36 && O.mapOptional("Type", R.Type) //
37 ;
38}
39
41 return Object{
42 {"Name", Params.Name},
43 {"Description", Params.Description},
44 };
45}
46bool nixd::fromJSON(const Value &Params, OptionField &R, Path P) {
47 ObjectMapper O(Params, P);
48 return O //
49 && O.mapOptional("Description", R.Description) //
50 && O.mapOptional("Name", R.Name) //
51 ;
52}
53
55 return Object{
56 {"Name", Params.Name},
57 {"PName", Params.PName},
58 {"Version", Params.Version},
59 {"Description", Params.Description},
60 {"LongDescription", Params.LongDescription},
61 {"Position", Params.Position},
62 {"Homepage", Params.Homepage},
63 };
64}
65
66bool nixd::fromJSON(const llvm::json::Value &Params, PackageDescription &R,
67 llvm::json::Path P) {
68 ObjectMapper O(Params, P);
69 return O //
70 && O.map("Name", R.Name) //
71 && O.map("PName", R.PName) //
72 && O.map("Version", R.Version) //
73 && O.map("Description", R.Description) //
74 && O.map("LongDescription", R.LongDescription) //
75 && O.map("Position", R.Position) //
76 && O.map("Homepage", R.Homepage) //
77 ;
78}
79
81 return Object{
82 {"Type", Params.Type},
83 {"Location", Params.Location},
84 };
85}
86
87bool nixd::fromJSON(const llvm::json::Value &Params, ValueMeta &R,
88 llvm::json::Path P) {
89 ObjectMapper O(Params, P);
90 return O //
91 && O.map("Type", R.Type) //
92 && O.mapOptional("Location", R.Location) //
93 ;
94}
95
97 return Object{
98 {"Meta", Params.Meta},
99 {"PackageDesc", Params.PackageDesc},
100 };
101}
102
103bool nixd::fromJSON(const llvm::json::Value &Params, AttrPathInfoResponse &R,
104 llvm::json::Path P) {
105 ObjectMapper O(Params, P);
106 return O //
107 && O.map("Meta", R.Meta) //
108 && O.mapOptional("PackageDesc", R.PackageDesc) //
109 ;
110}
111
113 return Object{{"Scope", Params.Scope}, {"Prefix", Params.Prefix}};
114}
115bool nixd::fromJSON(const llvm::json::Value &Params, AttrPathCompleteParams &R,
116 llvm::json::Path P) {
117 ObjectMapper O(Params, P);
118 return O //
119 && O.map("Scope", R.Scope) //
120 && O.map("Prefix", R.Prefix) //
121 ;
122}
Types used in nixpkgs provider.
std::string Path
Definition Path.h:24
bool fromJSON(const llvm::json::Value &Params, Configuration::Diagnostic &R, llvm::json::Path P)
llvm::json::Value toJSON(const PackageDescription &Params)
Definition AttrSet.cpp:54
std::string Prefix
Search for packages prefixed with this "prefix".
Definition AttrSet.h:96
ValueMeta Meta
General value description.
Definition AttrSet.h:83
PackageDescription PackageDesc
Package description of the attribute path, if available.
Definition AttrSet.h:86
std::vector< lspserver::Location > Definitions
Definition AttrSet.h:117
std::optional< std::string > Description
Definition AttrSet.h:115
std::optional< std::string > Example
Definition AttrSet.h:118
std::optional< OptionType > Type
Definition AttrSet.h:119
std::vector< lspserver::Location > Declarations
Definition AttrSet.h:116
std::optional< OptionDescription > Description
Definition AttrSet.h:128
std::string Name
Definition AttrSet.h:127
std::optional< std::string > Description
Definition AttrSet.h:106
std::optional< std::string > Name
Definition AttrSet.h:107
std::optional< std::string > Name
Definition AttrSet.h:50
std::optional< std::string > Version
Definition AttrSet.h:52
std::optional< std::string > PName
Definition AttrSet.h:51
std::optional< std::string > Description
Definition AttrSet.h:53
std::optional< std::string > LongDescription
Definition AttrSet.h:54
std::optional< std::string > Position
Definition AttrSet.h:55
std::optional< std::string > Homepage
Definition AttrSet.h:56
General metadata of all nix::Values.
Definition AttrSet.h:64
std::optional< lspserver::Location > Location
Location of the value.
Definition AttrSet.h:74
int Type
Type of this value.
Definition AttrSet.h:66