[Update] Dune Package Management Support in VSCode

We are happy to announce improvements to the OCaml VSCode Extension relating to Dune Package Management (DPM). This update includes several bug fixes and quality-of-life improvements.
In this new update: to activate DPM as a sandbox:

  • First, select “Dune Package Management” from the sandbox list.
  • Then a list of dune binaries installed on your computer is displayed to you. Once you select a dune binary, DPM becomes activated for your project.

DPM initializes ocaml-lsp-server for you in the background once it is activated and the extension has helpful suggestions, such as asking you to “lock” your project if you haven’t enabled DPM yet. (Enabling DPM can be done either in the dune-workspace file, or by running dune pkg lock).
Once both are done, things work nicely.
Notes:

  • Other features supported by opam sandboxes such as listing installed dependencies, upgrading and uninstalling packages are not yet supported for DPM.
  • If you run dune in watch mode or you run a long-lasting dune command, then DPM on VSCode will not work reliably as the dune build directory will be locked until the currently running process terminates.

You can see more about the changes we have done on the project board.
This work was achieved by a group of Tarides notably Pixie Dust, Timéo Arnouts, Ulysse Gerard, Sonja Heinze, Shon Feder, Ali Caglayan, and Sudha Parimala.

5 Likes