Merlin not working in Visual Studio Code : trouble reading both Ocaml & Node.js

So far, for a long time I used VSCode on my Mac to edit OCaml projects only. Recently I started extending my use of VSCode to include the editing of Node.js projects (in separate windows, of course).

Now when I return to my Ocaml window I find that merlin is not working any more : as you can see in the image below, when I try to do something very basic as asking the editor to find the definition of a value (that happens to be 3 lines above in the same file), the menu produced by the Ctrl+Click shortcut does not include “Go To Definition” as it should.

VSCode still seems to recognize that this is an OCaml file and that merlin is present however (notice the “OCaml” and the “merlin” in the bottom bar).

How can I fix this ?

I think you’re using older ocaml extension for vscode. Consider switching to the extension “OCaml Platform”. Don’t forget to install ocaml-lsp that is required by the extension.


The installation instructions say : “enter ext install ocamllabs.ocaml-platform at the command palette Cmd+Shift+P on MacOS)” but when I do that, I get the error message “No matching commands”

I’d recommend just using the extension manager to install the extension