Skip to content

Commit

Permalink
Merge pull request ocaml#1784 from voodoos/occ-tweaks
Browse files Browse the repository at this point in the history
Prepare release of merlin 5.1-502
  • Loading branch information
voodoos authored Jun 18, 2024
2 parents b602e95 + 1e934d6 commit ce00b5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 4 additions & 0 deletions merlin.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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"]
]
3 changes: 2 additions & 1 deletion src/analysis/occurrences.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ce00b5b

Please sign in to comment.