From 31c62ee69f3b4d61126f5708e761fb3bc4e980cb Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Wed, 4 Jan 2023 18:41:11 +0100 Subject: [PATCH 1/2] detect -open Belt, and adjust what modules we complete from accordingly --- analysis/src/Packages.ml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/analysis/src/Packages.ml b/analysis/src/Packages.ml index 7e2ca25e0..3c90d7b52 100644 --- a/analysis/src/Packages.ml +++ b/analysis/src/Packages.ml @@ -112,6 +112,24 @@ let newBsPackage ~rootPath = listModulePath = ["List"]; resultModulePath = ["Result"]; } + else if + opens_from_bsc_flags + |> List.find_opt (fun opn -> + match opn with + | ["Belt"] -> true + | _ -> false) + |> Option.is_some + then + { + arrayModulePath = ["Array"]; + optionModulePath = ["Option"]; + stringModulePath = ["Js"; "String2"]; + intModulePath = ["Int"]; + floatModulePath = ["Float"]; + promiseModulePath = ["Js"; "Promise"]; + listModulePath = ["List"]; + resultModulePath = ["Result"]; + } else { arrayModulePath = ["Js"; "Array2"]; From 6d8cc86a12abcbfb06512a0052618bb13a43f6e6 Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Wed, 4 Jan 2023 18:43:43 +0100 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2840e47b5..46181e0ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,8 +12,6 @@ ## master -## v1.10.0 - #### :rocket: New Feature - Add autocomplete for function argument values (booleans, variants and options. More values coming), both labelled and unlabelled. https://github.com/rescript-lang/rescript-vscode/pull/665 @@ -23,6 +21,12 @@ #### :nail_care: Polish +- Prefer opened `Belt` modules in autocomplete when `-open Belt` is detected in `bsconfig`. https://github.com/rescript-lang/rescript-vscode/pull/673 + +## v1.10.0 + +#### :nail_care: Polish + - Remove spacing between type definition in clients that do not support markdown links. https://github.com/rescript-lang/rescript-vscode/pull/619 - Rename custom LSP methods names. https://github.com/rescript-lang/rescript-vscode/pull/611 - Better performance for Inlay Hints and Codelens. https://github.com/rescript-lang/rescript-vscode/pull/634