Skip to content

Commit 6ea3d1c

Browse files
authored
Account for namespace when filtering pipe completion items (#843)
* account for namespace when filtering pipe completion items * changelog
1 parent 2c2552e commit 6ea3d1c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#### :bug: Bug Fix
1616

1717
- 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
18+
- Account for namespace when filtering pipe completion items. https://github.com/rescript-lang/rescript-vscode/pull/843
1819

1920
## 1.22.0
2021

analysis/src/CompletionBackEnd.ml

+4
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,10 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
943943
| [_], _ -> Some modulePath
944944
| s :: inner, first :: restPath when s = first ->
945945
removeRawOpen inner restPath
946+
| s :: inner, first :: restPath
947+
when String.contains first '-' && Utils.startsWith first s ->
948+
(* This handles namespaced modules, which have their namespace appended after a '-' *)
949+
removeRawOpen inner restPath
946950
| _ -> None
947951
in
948952
let rec removeRawOpens rawOpens modulePath =

0 commit comments

Comments
 (0)