Skip to content

Commit d7af028

Browse files
committed
Extend mk_package
1 parent 30f7454 commit d7af028

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

tools/src/print_tast.ml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,86 @@ module Transform = struct
123123
}
124124
:: fields)
125125

126+
let mk_FileSet (fileSet : SharedTypes.FileSet.t) : oak =
127+
List (fileSet |> SharedTypes.FileSet.to_list |> List.map (fun s -> String s))
128+
129+
let mk_builtInCompletionModules
130+
(builtInCompletionModules : SharedTypes.builtInCompletionModules) : oak =
131+
Record
132+
[
133+
{
134+
name = "arrayModulePath";
135+
value = mk_string_list builtInCompletionModules.arrayModulePath;
136+
};
137+
{
138+
name = "optionModulePath";
139+
value = mk_string_list builtInCompletionModules.optionModulePath;
140+
};
141+
{
142+
name = "stringModulePath";
143+
value = mk_string_list builtInCompletionModules.stringModulePath;
144+
};
145+
{
146+
name = "intModulePath";
147+
value = mk_string_list builtInCompletionModules.intModulePath;
148+
};
149+
{
150+
name = "floatModulePath";
151+
value = mk_string_list builtInCompletionModules.floatModulePath;
152+
};
153+
{
154+
name = "promiseModulePath";
155+
value = mk_string_list builtInCompletionModules.promiseModulePath;
156+
};
157+
{
158+
name = "listModulePath";
159+
value = mk_string_list builtInCompletionModules.listModulePath;
160+
};
161+
{
162+
name = "resultModulePath";
163+
value = mk_string_list builtInCompletionModules.resultModulePath;
164+
};
165+
{
166+
name = "exnModulePath";
167+
value = mk_string_list builtInCompletionModules.exnModulePath;
168+
};
169+
{
170+
name = "regexpModulePath";
171+
value = mk_string_list builtInCompletionModules.regexpModulePath;
172+
};
173+
]
174+
126175
let mk_package (package : SharedTypes.package) : oak =
127176
Record
128177
[
129178
{
130179
name = "genericJsxModule";
131180
value = mk_string_option package.genericJsxModule;
132181
};
182+
{name = "suffix"; value = String package.suffix};
183+
{name = "rootPath"; value = String package.rootPath};
184+
{name = "projectFiles"; value = mk_FileSet package.projectFiles};
185+
{
186+
name = "dependenciesFiles";
187+
value = mk_FileSet package.dependenciesFiles;
188+
};
189+
{name = "namespace"; value = mk_string_option package.namespace};
190+
{
191+
name = "builtInCompletionModules";
192+
value = mk_builtInCompletionModules package.builtInCompletionModules;
193+
};
194+
{name = "opens"; value = mk_string_list (List.concat package.opens)};
195+
{name = "uncurried"; value = mk_bool package.uncurried};
196+
{
197+
name = "rescriptVersion";
198+
value =
199+
(let major, minor = package.rescriptVersion in
200+
Tuple
201+
[
202+
{name = "major"; value = String (string_of_int major)};
203+
{name = "minor"; value = String (string_of_int minor)};
204+
]);
205+
};
133206
]
134207

135208
let mk_Uri (uri : Uri.t) : oak = String (Uri.toString uri)

0 commit comments

Comments
 (0)