Dune projects: editor/ide for best goto-def, type inference, intellisense

For projects configured with dune:

Between vim, emacs, vscode, intellij, what offers the best:

  • goto def (even for jumping into dependencies)
  • type inference (i.e. show me type signature of local lets)
  • intellisense (give me auto complete)

I’ve currently been playing with vim + merlin + ocaml-lsp-server + vscode, but never quite got anything that works as well as Rust/IntelliJ.

What editor/ide setup gives me the most “stable” for handling the three features above? Especially important to me is being able to jump into dependencies and read the type sig / code. (It needs something that looks at more than just my code, but into the dependencies).

There’s no real difference between all the available solutions. All the main editors have access to either merlin or ocaml-lsp-server. And ocaml-lsp-server is based on merlin. So it’s basically all the same thing.

In general there should be no problem with type inference. Intellisense works decently in some context, amazingly sometimes, and not at all with things like objects. Goto def might be able to jump to a dependency, depending on how that dependency was installed, but it will not be possible to navigate inside that dependency in a reliable way.

It seems to me that ocaml-lsp-server does a few things that merlin don’t do, like talking to dune when dune is in watch mode. But I might be mistaken.

Note that the experience isn’t as good when using camlp4/5/cppo, as merlin isn’t able to completely parse all those syntax extensions (I’ve seen other topics where you talk about camlp5).