Skip to content

Commit 86e4808

Browse files
committed
adjust autocomplete to recent changes in stdlib
1 parent f72c853 commit 86e4808

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

analysis/src/CompletionBackEnd.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,8 @@ let rec getCompletionsForContextPath ~package ~opens ~rawOpens ~allFiles ~pos
12901290
intModulePath;
12911291
floatModulePath;
12921292
promiseModulePath;
1293+
listModulePath;
1294+
resultModulePath;
12931295
} =
12941296
package.builtInCompletionModules
12951297
in
@@ -1307,9 +1309,9 @@ let rec getCompletionsForContextPath ~package ~opens ~rawOpens ~allFiles ~pos
13071309
| Path.Pident id when Ident.name id = "int" -> intModulePath
13081310
| Path.Pident id when Ident.name id = "float" -> floatModulePath
13091311
| Path.Pident id when Ident.name id = "promise" -> promiseModulePath
1310-
| Path.Pident id when Ident.name id = "list" -> ["Belt"; "List"]
1312+
| Path.Pident id when Ident.name id = "list" -> listModulePath
1313+
| Path.Pident id when Ident.name id = "result" -> resultModulePath
13111314
| Path.Pident id when Ident.name id = "lazy_t" -> ["Lazy"]
1312-
| Path.Pident id when Ident.name id = "result" -> ["Belt"; "Result"]
13131315
| Path.Pident id when Ident.name id = "char" -> ["Char"]
13141316
| _ -> (
13151317
match loop path with

analysis/src/Packages.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ let newBsPackage ~rootPath =
9898
opens_from_bsc_flags
9999
|> List.find_opt (fun opn ->
100100
match opn with
101-
| ["ReScriptStdLib"] -> true
101+
| ["RescriptStdlib"] -> true
102102
| _ -> false)
103103
|> Option.is_some
104104
then
@@ -109,6 +109,8 @@ let newBsPackage ~rootPath =
109109
intModulePath = ["Int"];
110110
floatModulePath = ["Float"];
111111
promiseModulePath = ["Promise"];
112+
listModulePath = ["List"];
113+
resultModulePath = ["Result"];
112114
}
113115
else
114116
{
@@ -118,6 +120,8 @@ let newBsPackage ~rootPath =
118120
intModulePath = ["Belt"; "Int"];
119121
floatModulePath = ["Belt"; "Float"];
120122
promiseModulePath = ["Js"; "Promise"];
123+
listModulePath = ["Belt"; "List"];
124+
resultModulePath = ["Belt"; "Result"];
121125
});
122126
})))
123127
| None -> None)

analysis/src/SharedTypes.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ type builtInCompletionModules = {
368368
intModulePath: string list;
369369
floatModulePath: string list;
370370
promiseModulePath: string list;
371+
listModulePath: string list;
372+
resultModulePath: string list;
371373
}
372374

373375
type package = {

0 commit comments

Comments
 (0)