How to set VS Code OCaml Platform in a non dune environment

Hi,
I’m using js_of_ocam in vscode. I didn’t use dune, instead, I used one line command to compile a single .ml file: ocamlfind ocamlc -package js_of_ocaml-ppx -package js_of_ocaml -linkpkg -o output/main.byte main.ml

It compiled fine. But in vscode, there’s this error Unbound module Js_of_ocamlocamllsp.
I’ve already configured the sandbox to the global switch.

Thanks a lot if someone could help me.

Or is it not very doable?

To use ocamllsp, one must build the project with dune. Ocamllsp needs to know where build artifacts live and how they are related to your source file, so this limitation is fundamental

2 Likes