I’ve re-installed opam from scratch, after doing a rm -rf ~/.opam, and then installed a switch based on 4.14.0.
The problem I’m encountering now is that VSCode “cannot find merlin binary” (even though which ocamlmerlin returns the correct answer /Users/jonathandoyle/.opam/four_fourteen/bin/ocamlmerlin in any terminal).
Indeed, and this package is “Reason+OCaml” as indicated in the error message. I disabled it and the error message is gone. Thanks for the help
OCaml Platform and ocaml-lsp-server are installed indeed.
My troubles are not finished, though : the “goto definition” feature does not work across files (although it does work inside a single file and type hints work as well).
Ok, the problem is that ocaml-lsp-server does not load .merlin files anymore by default.
I think there is a flag for that (--fallback-read-dot-merlin). But, looking at the settings panel of the vscode plugin, I don’t see where this flag can be added.
@rgrinberg@Ulugbek : what is the intended way to use that flag ? Also, it would be very useful if ocaml-lsp-servercould hint that user might want to use that fallback flag, and the vscode extension have an easy-to-toggle setting.
Also, I noticed that opam tells me that ocaml-lsp-server is installed with version 1.14.1, and that I have a ~/.opam/four_fourteen/lib/ocaml-lsp-server directory containing a few files (dune-package, META and opam), but I don’t have an ~/.opam/four_fourteen/bin/ocaml-lsp-server binary. Shouldn’t there be one ?
If you say so. So far I don’t consider my OCaml projects to be likely to be useful to other people, which is why I never bothered to build them with dune (and so far I don’t see what benefits dune brings to amateurs only programming for themselves like me).
Is it simple to “dunify” a large product originally created and maintained without dune ?
For large projects, writing .merlin files and verifying they work correctly is just as much work as porting them to dune.
This is an interesting use case. Though it seems like it would be just as easy for users to write a dune file to describe their project in parallel to their build system. It would be useful to both verify their makefiles work and get free editor support
I should clarify that I’m not against supporting .merlin files by default in principle. I just dislike how they are generated in the source directory. I’d be willing to support any build system that generates this stuff in a dedicated build directory.