How to pass --fallback-read-dot-merlin to ocamllsp in vscode-ocaml-platform extension?

In a project that uses OMicroB, vscode is unable to find the cmi files which are installed outside of opam’s sandbox in /usr/local/lib/omicrob. How can I set up the vscode-ocaml-platform extension to look in that directory? Is there a way to pass --fallback-read-dot-merlin to ocamllsp used by the extension?

We also use this feature for Melange. You can find instructions here

In theory that’s what I need. In practice I’m not able to get it to work. Here’s my vscode config:

    "ocaml.sandbox": {
        "kind": "custom",
        "template": "opam exec --switch=4.14.0 --set-switch -- $prog $args --fallback-read-dot-merlin"

My .merlin file is fine because it works with vim. But vscode still does not find the cmi’s in /usr/local/lib/omicrob.

vscode extension has a setting called extraEnv which allows to pass env vars to ocamllsp, but last I checked this didn’t work for me :sweat_smile:

edit: this actually works

On a side note: I’m very happy to see support for dot-merlin added back into ocaml-lsp, I’m still a big user of .merlin files.

Anyone know how to pass a command line argument on Emacs lsp-mode?