From 71b69b31b705254678f89e8cf191c1a89834bc21 Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Sat, 11 Nov 2023 21:16:39 +0100 Subject: [PATCH 1/2] account for namespace when filtering pipe completion items --- analysis/src/CompletionBackEnd.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/analysis/src/CompletionBackEnd.ml b/analysis/src/CompletionBackEnd.ml index 040ff5843..e26048a4b 100644 --- a/analysis/src/CompletionBackEnd.ml +++ b/analysis/src/CompletionBackEnd.ml @@ -943,6 +943,10 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact | [_], _ -> Some modulePath | s :: inner, first :: restPath when s = first -> removeRawOpen inner restPath + | s :: inner, first :: restPath + when String.contains first '-' && Utils.startsWith first s -> + (* This handles namespaced modules, which have their namespace appended after a '-' *) + removeRawOpen inner restPath | _ -> None in let rec removeRawOpens rawOpens modulePath = From 112f3a23e10669881b8264c9211584e8aec25eaf Mon Sep 17 00:00:00 2001 From: Gabriel Nordeborn Date: Sat, 11 Nov 2023 21:19:52 +0100 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbc63eb3e..79db7d685 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ #### :bug: Bug Fix - Fix issue `open` on submodules exposed via `-open` in bsconfig.json/rescript.json, that would cause the content of those `open` modules to not actually appear in autocomplete. https://github.com/rescript-lang/rescript-vscode/pull/842 +- Account for namespace when filtering pipe completion items. https://github.com/rescript-lang/rescript-vscode/pull/843 ## 1.22.0