← All extensions

OCaml

v0.4.1 · by Rashid Almheiri · added 3 November 2026

OCaml support.

LanguagesLanguage servers

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

An OCaml extension for Zed.

This extension includes support for:

  • OCaml (.ml) and OCaml Interface (.mli)
  • OCaml MLX (.mlx)
  • Reason (.re and .rei)
  • Dune (dune, dune-project and dune-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:

  1. Dune Package Management — If dune is in PATH and dune pkg enabled succeeds, starts the LSP via dune tools exec ocamllsp.
  2. opam — If opam is in PATH, starts via opam exec -- ocamllsp. If a local switch (_opam/) is found in the project root, it is used automatically.
  3. Direct — Falls back to running ocamllsp directly 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.