diff --git a/CHANGES.md b/CHANGES.md index 1cb363cbe..2ab336785 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,6 @@ -UNRELEASED +merlin 5.1 ========== +Tue Jun 18 12:00:42 CEST 2024 + merlin binary - Support project-wide occurrences queries using index files (#1766) diff --git a/merlin.opam b/merlin.opam index bd1093a7f..ff3f8f67e 100644 --- a/merlin.opam +++ b/merlin.opam @@ -15,6 +15,7 @@ depends: [ "dune" {>= "3.0.0"} "merlin-lib" {= version} "dot-merlin-reader" {>= "5.0"} + "ocaml-index" {>= "1.0" & post} "yojson" {>= "2.0.0"} "conf-jq" {with-test} "ppxlib" {with-test} @@ -70,3 +71,6 @@ See https://github.com/OCamlPro/opam-user-setup " {success & !user-setup:installed} ] +pin-depends: [ + ["ocaml-index.1.0" "git+https://github.com/voodoos/ocaml-index#82b08987921884daeeb5dccc345a2dcb667fe113"] +] diff --git a/src/analysis/occurrences.ml b/src/analysis/occurrences.ml index a57200179..f0db4a9a1 100644 --- a/src/analysis/occurrences.ml +++ b/src/analysis/occurrences.ml @@ -230,8 +230,9 @@ let locs_of ~config ~env ~typer_result ~pos ~scope path = log ~title:"occurrences" "Found %i locs" (Lid_set.cardinal locs); Lid_set.elements locs |> List.filter_map ~f:(fun {Location.txt; loc} -> + let lid = try Longident.head txt with _ -> "not flat lid" in log ~title:"occurrences" "Found occ: %s %a" - (Longident.head txt) Logger.fmt (Fun.flip Location.print_loc loc); + lid Logger.fmt (Fun.flip Location.print_loc loc); let loc = last_loc loc txt in let fname = loc.Location.loc_start.Lexing.pos_fname in if not (Filename.is_relative fname) then Some loc else