@@ -562,7 +562,7 @@ let completionForExporteds iterExported getDeclared ~prefix ~exact ~env
562562 with
563563 deprecated = declared.deprecated;
564564 docstring = declared.docstring;
565- modulePath = ModulePath. toFullPath declared.modulePath;
565+ modulePath = declared.modulePath;
566566 }
567567 :: ! res
568568 | _ -> () );
@@ -1358,20 +1358,20 @@ let rec getCompletionsForContextPath ~package ~opens ~rawOpens ~allFiles ~pos
13581358 | [] -> modulePath
13591359 in
13601360 match lhsPath with
1361- | Some modulePath -> (
1362- match modulePath with
1361+ | Some lhsPath -> (
1362+ match lhsPath with
13631363 | _ :: _ ->
1364- let modulePathMinusOpens =
1365- modulePath
1364+ let lhsPathMinusOpens =
1365+ lhsPath
13661366 |> removeRawOpens package.opens
13671367 |> removeRawOpens rawOpens |> String. concat " ."
13681368 in
13691369 let completionName name =
1370- if modulePathMinusOpens = " " then name
1371- else modulePathMinusOpens ^ " ." ^ name
1370+ if lhsPathMinusOpens = " " then name
1371+ else lhsPathMinusOpens ^ " ." ^ name
13721372 in
13731373 let completions =
1374- modulePath @ [funNamePrefix]
1374+ lhsPath @ [funNamePrefix]
13751375 |> getCompletionsForPath ~completion Context:Value ~exact: false
13761376 ~package ~opens ~all Files ~pos ~env ~scope
13771377 in
@@ -1388,22 +1388,22 @@ let rec getCompletionsForContextPath ~package ~opens ~rawOpens ~allFiles ~pos
13881388 file module name it was found in. We pluck that off here if the env
13891389 we're in is the same as the completion item was found in. This ensures
13901390 that a correct qualified path can be produced. *)
1391- let modulePath =
1392- match completionItemModulePath with
1391+ let completionPath =
1392+ match ModulePath. toFullPath completionItemModulePath with
13931393 | topModule :: rest when topModule = env.file.moduleName -> rest
13941394 | modulePath -> modulePath
13951395 in
1396- let modulePathMinusOpens =
1397- modulePath
1396+ let completionPathMinusOpens =
1397+ completionPath
13981398 |> removeRawOpens package.opens
13991399 |> removeRawOpens rawOpens |> String. concat " ."
14001400 in
14011401 let completionName name =
1402- if modulePathMinusOpens = " " then name
1403- else modulePathMinusOpens ^ " ." ^ name
1402+ if completionPathMinusOpens = " " then name
1403+ else completionPathMinusOpens ^ " ." ^ name
14041404 in
14051405 let completions =
1406- completionItemModulePath @ [funNamePrefix]
1406+ completionPath @ [funNamePrefix]
14071407 |> getCompletionsForPath ~completion Context:Value ~exact: false
14081408 ~package ~opens ~all Files ~pos ~env ~scope
14091409 in
0 commit comments