Skip to content

Commit ee2d814

Browse files
committed
more sane way of ensuring the file module name gets picked up
1 parent defb77c commit ee2d814

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

analysis/src/CompletionBackEnd.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,7 @@ let completionForExporteds iterExported getDeclared ~prefix ~exact ~env
562562
with
563563
deprecated = declared.deprecated;
564564
docstring = declared.docstring;
565-
modulePath =
566-
[env.file.moduleName]
567-
@ ModulePath.toPathWithoutTip declared.modulePath;
565+
modulePath = ModulePath.toFullPath declared.modulePath;
568566
}
569567
:: !res
570568
| _ -> ());
@@ -1292,7 +1290,7 @@ let rec getCompletionsForContextPath ~package ~opens ~rawOpens ~allFiles ~pos
12921290
~env ~exact:true ~scope
12931291
|> completionsGetTypeEnv
12941292
with
1295-
| Some (typ, _envFromCompletion, completionItemModulePath) -> (
1293+
| Some (typ, _envFromCompletionItem, completionItemModulePath) -> (
12961294
let {
12971295
arrayModulePath;
12981296
optionModulePath;

analysis/src/SharedTypes.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ module ModulePath = struct
2323
in
2424
loop modulePath [tipName]
2525

26-
let toPathWithoutTip modulePath : path =
26+
let toFullPath modulePath : path =
2727
let rec loop modulePath current =
2828
match modulePath with
29-
| File _ -> current
29+
| File (_, fileModule) -> fileModule :: current
3030
| IncludedModule (_, inner) -> loop inner current
3131
| ExportedModule {name; modulePath = inner} -> loop inner (name :: current)
3232
| NotVisible -> current

0 commit comments

Comments
 (0)