Visual Studio Code extension for OCaml and relevant tools.
This plugin is alpha quality. Use at your own risk and please report any bugs you encounter.
- Install this extension from
the VSCode Marketplace
(or by entering
ext install ocamllabs.ocaml-platform
at the command palette Ctrl+P) - Open a OCaml/ReasonML project (
File > Add Folder to Workspace...
) - Install OCaml-LSP with opam or esy.
There is currently no way of installing OCaml-LSP natively for BuckleScript projects. As a fast workaround, you can use esy:
- Install esy
npm install esy --global
- Add
esy.json
to the project root with following content:
{
"dependencies": {
"@opam/ocaml-lsp-server": "ocaml/ocaml-lsp:ocaml-lsp-server.opam",
"@opam/reason": "*",
"ocaml": "4.6.x"
},
"resolutions": {
"@opam/dune-configurator": "2.0.1",
"@opam/dune-private-libs": "2.0.1",
"@opam/dune": "2.0.1",
"@opam/menhir": "20200123",
"@opam/menhirLib": "20200123",
"@opam/menhirSdk": "20200123"
}
}
- Install and build packages
esy
- Syntax highlighting
- ATD
- Cram tests
- Dune
- Menhir
- Merlin
- META
- OCaml
- OCamlbuild
- OCamlFormat
- OCamllex
- opam
- ReasonML
- Indentation rules
- Snippets
- Dune
- OCaml
- OCamllex
This extension provides options in VSCode's configuration settings. You can find
the settings under File > Preferences > Settings
.
Name | Description | Default |
---|---|---|
ocaml.sandbox |
Determines where to find the sandbox for a given project | null |
You can execute it by entering the following command at the command palette Ctrl+P.
Name | Description | Keyboard Shortcuts | Menu Contents |
---|---|---|---|
ocaml.select-sandbox |
Select sandbox for this workspace |