I’m rather new to OCaml so not sure if this is a solved problem that I’ve missed, however I’m having some issues making my way around libraries to be able to inspect interfaces / implementations.
I can usually navigate to a .mli
or .ml
file using merlin-locate
(in Emacs) just fine from my code, but then I can’t go anywhere further from there, and get a "Not in environment '<package-name>'"
message from Merlin. For example, if I have, say, let f = Async.Tcp.Where_to_connect.of_file
, then I am able to navigate using merlin-locate
to the Tcp.Where_to_connect
module ok, but within that if I then want to go to the Socket.Address
module that it uses (and is also part of Async
), then I get the message "Not in environment 'Socket.Address'"
.
I looked around and came across a couple issues on the Merlin GitHub, and specifically this wiki page https://github.com/ocaml/merlin/wiki/Letting-merlin-locate-go-to-stuff-in-.opam has a solution, however I don’t believe this would work with Dune as it takes care of managing the .merlin
file.
Not sure if this kind of navigation is possible or if I’ve missed a trick, but I assume a lot of people would want to move around the libraries they have defined as a dependency in their Dune file, so I’m wondering does anyone know if there is a way to do this? Thanks!