On behalf of the VSCode development team, I’m happy to announce a new release of VSCode’s OCaml Platform extension.
Release 1.7.0 was broken, so we released 1.8.0 a few hours later with a fix and some additional features.
The most important change with this release is the automatic installation of Platform tools.
Previously, the extension needed Platform tools (for now, ocaml-lsp-server
and ocamlformat
) to be installed in the selected sandbox to work. This is not longer the case: when selecting a sandbox, the extension will setup a private Opam switch with the same version of the compiler and install the platform tools in it. If the tools are installed in the sandbox, they will be used instead of the private switch, but it is not recommended to install them manually anymore.
Of course, that means that we have to set up a new switch every time you select a sandbox with a new compiler version, and this might take a few minutes, but your patience is well rewarded:
- The platform tools are global to all of your projects with the same compiler version: no more wasting time installing lsp and ocamlformat in every switch
- The platform tools don’t interfere with your local dependencies.
- Lastly, and most importantly for newcomers: if you have Opam on your system, you don’t need to do anything to have a working environment.
That’s a pretty big change to how you use the extension, so don’t hesitate if you have any questions and report any issue you’re having here.
Another addition is the integration with a REPL (Utop or OCaml toplevel). You can now select a piece of code and press Shift+Enter to run it in a REPL. Let us know what you think!
Changelog
1.8.0
-
Highlight OCaml source code inside Cinaps comments (#547)
-
Show the output of shell commands in an output channel.
The output channel is automatically focused when running a package management command from the OCaml activity tab (#541)
-
Fix highlighting of float literals with a trailing decimal point (#548)
-
Ask for confirmation when removing opam packages or switches (#551)
1.7.0
-
Fixed an issue when uninstalled Opam packages still appear in the roots field of Opam’s switch-state file (#517)
-
Fixed detection of local Opam switch on Windows (#518)
-
vscode-ocaml-platform now depends on ocaml-lsp-server.1.3.0
-
Add a command to open a Utop REPL in the current sandbox (#504)
-
Add a code evaluation command that sends selected expressions to the REPL (#504)
-
Install OCaml Platform tools automatically (#463)
The platform tools (a.k.a toolchain) are installed in a private opam switch that should only be used by vscode-ocaml-platform.