OCaml
OCaml support.
How to install
With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.
You can also open the Extensions panel in the app and search for OCaml. The extension's id is ocaml.
Don't have Forge Super yet? Download it here.
README
From the extension's repository, written by its authors and not by Mentenaz. See the source.
Zed OCaml
This extension includes support for:
- OCaml (
.ml) and OCaml Interface (.mli) - OCaml MLX (
.mlx) - Reason (
.reand.rei) - Dune (
dune,dune-projectanddune-workspace) - Menhir (
.mly) - OCamllex (
.mll) - Odoc (
.mld)
Language Server
The extension automatically detects how to start ocamllsp based on your project setup, using the following priority order:
- Dune Package Management — If
duneis in PATH anddune pkg enabledsucceeds, starts the LSP viadune tools exec ocamllsp. - opam — If
opamis in PATH, starts viaopam exec -- ocamllsp. If a local switch (_opam/) is found in the project root, it is used automatically. - Direct — Falls back to running
ocamllspdirectly from PATH.
Configuration
OCamllsp can be configured via Zed settings.json.
For instance, all inlay hints can be enabled using the following:
"lsp": {
"ocamllsp": {
"settings": {
"inlayHints": {
"hintFunctionParams": true,
"hintPatternVariables": true,
"hintLetBindings": true
}
}
}
}
The configuration options available are documented here.
Development
To develop this extension, see the Developing Extensions section of the Zed docs.