This project contains an implementation of an LSP server for OCaml and a standalone implementation of the LSP protocol.
We recommend to install the server via a project such as opam or esy.
To install the lsp server in a particular opam switch:
$ opam install ocaml-lsp-server
Note that you will need to run install the lsp server in every switch where you'd like to use it.
This project uses submodules to handle dependencies. This is done so that users who install ocaml-lsp-server into their sandbox will not share constraints on the same dependencies that ocaml-lsp-server is using.
$ git clone --recurse-submodules http://github.com/ocaml/ocaml-lsp.git
$ cd ocaml-lsp
$ dune build
The lsp server uses merlin under the hood, but users are not required to have merlin installed. We vendor merlin because we currently heavily depend on some implementation details of merlin that make infeasible to upgrade the lsp server and merlin independently.
The implementation of the lsp protocol itself was taken from facebook's hack
Previously, this lsp server was a part of merlin, until it was realized that the lsp protocol covers a wider scope than merlin.