Skip to content

Commit

Permalink
Support project wide occurrences
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoos committed Jan 29, 2024
1 parent d3d8de5 commit 69fea3a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ocaml-lsp-server/src/ocaml_lsp_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,22 @@ let references (state : State.t)
let+ locs =
Document.Merlin.dispatch_exn
doc
(Occurrences (`Ident_at (Position.logical position), `Buffer))
(Occurrences (`Ident_at (Position.logical position), `Project))
in
Some
(List.map locs ~f:(fun loc ->
let range = Range.of_loc loc in
(* using original uri because merlin is looking only in local file *)
let uri =
match loc.loc_start.pos_fname with
| "" -> uri
| path -> Uri.of_path path
in
Log.log ~section:"debug" (fun () ->
Log.msg
"merlin returned fname %a"
[ ("pos_fname", `String loc.loc_start.pos_fname)
; ("uri", `String (Uri.to_string uri))
]);
{ Location.uri; range }))

let highlight (state : State.t)
Expand Down

0 comments on commit 69fea3a

Please sign in to comment.