Skip to content

Commit c1c2bb0

Browse files
committed
detect -open Belt, and adjust what modules we complete from accordingly
1 parent 001970f commit c1c2bb0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

analysis/src/Packages.ml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,24 @@ let newBsPackage ~rootPath =
112112
listModulePath = ["List"];
113113
resultModulePath = ["Result"];
114114
}
115+
else if
116+
opens_from_bsc_flags
117+
|> List.find_opt (fun opn ->
118+
match opn with
119+
| ["Belt"] -> true
120+
| _ -> false)
121+
|> Option.is_some
122+
then
123+
{
124+
arrayModulePath = ["Array"];
125+
optionModulePath = ["Option"];
126+
stringModulePath = ["Js"; "String2"];
127+
intModulePath = ["Int"];
128+
floatModulePath = ["Float"];
129+
promiseModulePath = ["Js"; "Promise"];
130+
listModulePath = ["List"];
131+
resultModulePath = ["Result"];
132+
}
115133
else
116134
{
117135
arrayModulePath = ["Js"; "Array2"];

0 commit comments

Comments
 (0)