Skip to content

zed-extensions/ocaml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zed OCaml

An OCaml extension for Zed.

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.