Skip to content

Commit 2a6ce8c

Browse files
cristianoczth
authored andcommitted
Handle test with unit
1 parent 76296ee commit 2a6ce8c

File tree

2 files changed

+10
-344
lines changed

2 files changed

+10
-344
lines changed

analysis/src/CompletionBackEnd.ml

+9-7
Original file line numberDiff line numberDiff line change
@@ -1354,13 +1354,15 @@ let rec getCompletionsForContextPath ~package ~opens ~rawOpens ~allFiles ~pos
13541354
Some (List.rev rest)
13551355
| _ ->
13561356
(* Get the path from the comletion environment *)
1357-
let pathFromEnv =
1358-
let path = envFromCompletionItem.path in
1359-
if env.file.moduleName = envFromCompletionItem.file.moduleName
1360-
then path
1361-
else envFromCompletionItem.file.moduleName :: path
1362-
in
1363-
Some pathFromEnv))
1357+
let path = envFromCompletionItem.path in
1358+
if path = [] then None
1359+
else
1360+
let pathFromEnv =
1361+
if env.file.moduleName = envFromCompletionItem.file.moduleName
1362+
then path
1363+
else envFromCompletionItem.file.moduleName :: path
1364+
in
1365+
Some pathFromEnv))
13641366
| None -> None
13651367
in
13661368
match completionPath with

0 commit comments

Comments
 (0)