A language server for OCaml and related languages
TypeScript JavaScript
Latest commit 705627d Feb 21, 2017 @freebroccolo Fix up request types



A language server for OCaml and related languages


This is an implementation of the language server protocol for OCaml and related languages like BuckleScript and Reason.

Server Clients

For a full-featured client for this server see vscode-reasonml.

The language server protocol is still quite new but many other clients are being developed:

NOTE: Most of these clients have not yet been tested with the server.

Server Capabilities

  • OCaml support
  • Reason support
  • incremental document synchronization
  • code action provider
  • code lens provider
  • completion provider
  • definition provider
  • document formatting provider (Reason)
  • document highlight provider
  • document range formatting provider (Reason)
  • document symbol provider
  • hover provider
  • references provider
  • workspace symbol provider

Installing the Server


  • OCaml 4.02.3 or greater
  • Reason 1.4.0 (optional)
  • merlin 2.5.0 or greater

The server can be installed with npm:

npm install -g ocaml-language-server

Launching the Server

The server can be launched in the following ways:

ocaml-language-server --node-ipc
ocaml-language-server --socket={number}
ocaml-language-server --stdio

For node-based clients like vscode-reasonml --node-ipc is the most efficient approach. Clients written in other languages should use --stdio or --socket.

Building the server

Execute the following steps:

yarn install
yarn run compile