Skip to content

Commit

Permalink
Fix lazy loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
Drup committed Dec 18, 2018
1 parent c6ae283 commit ae47f48
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/browserMain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,13 @@ let filter_completion l =
(* Sort the list of completions. *)
let sort_completion l =
let cmp
{LibIndex. file = f1; loc_impl = lazy {loc_start = l1}}
{LibIndex. file = f2; loc_impl = lazy {loc_start = l2}} =
{LibIndex. file = f1; loc_impl = l1}
{LibIndex. file = f2; loc_impl = l2} =
let name_of_file (LibIndex.Cmi s | Cmt s | Cmti s) = s in
let i = String.compare (name_of_file f1) (name_of_file f2) in
if i <> 0 then i
else compare l1 l2
else
compare (Lazy.force l1).loc_start (Lazy.force l2).loc_start
in
List.sort cmp l

Expand Down

0 comments on commit ae47f48

Please sign in to comment.