Closed jonahbeckford closed 1 year ago
I think the most elegant solution would be to check if ocaml-env
exists before using it.
A PATH check could done inside this branch: https://github.com/ocamllabs/vscode-ocaml-platform/blob/5d33e8a8e2b1475296d0c971a19885987ce09d11/src/ocaml_windows.ml#L10-L11
Since Diskuv OCaml doesn't have ocaml-env
, the extension will use the Windows executables unless OCaml for Windows is installed. If a user has both OCaml for Windows and Diskuv OCaml, the ocaml.useOcamlEnv
setting can be used to decided which is used:
useOcamlEnv
is true.useOCamlEnv
is false.That is perfect! Thanks for the quick turnaround. I'll see about testing the PR.
On Windows the plugin defaults to requiring
ocaml.useOcamlEnv
.The Diskuv OCaml (DKML) distribution for Windows does not need wrappers. It works with the OCaml VSCode plugin as-is, and the plug-in doesn't see any switches when
ocaml.useOCamlEnv
is on.But I'm needing to tell new users to disable the
ocamlenv
setting. What do you suggest we do for Windows users?Nitty gritty details if it helps:
opam
anddune
, among other programs, in the Windows user PATH.opam
anddune
commands work just the same as on Unix (except they may report Windows paths likeC:\a\b\c
or mixed paths likeC:/a/b/c
).<LOCALAPPDATA>\opam
rather than<USERPROFILE>\.opam
(?) or whatever the OPAMROOT was. This different OPAMROOT used to be a problem with the plugin, but I suspect the plugin now doesopam var root
so the Opam 2.2+ OPAMROOT works. Confer: https://github.com/ocaml/opam/pull/4815$env:LOCALAPPDATA\Programs\DiskuvOCaml\dkmlvars-v2.sexp
on Windows, or$XDG_DATA_HOME/diskuv-ocaml/dkmlvars-v2.sexp
or$HOME/.local/share/diskuv-ocaml/dkmlvars-v2.sexp
if XDG_DATA_HOME not defined on Unix (there will be a version for macOS coming soon). I don't think you'll need it, but I'll describe it just in case. It looks like: