package menhir-lsp

  1. Overview
  2. Docs

Menhir LSP

menhir-lsp is a Language Server for the OCaml dialects Menhir and Ocamllex. Its goal is to provide rich IntelliSense in .mly and .mll files in client editors. A client for VS Code is available as a VS Code extension.

Capabilities

Installation & Usage

Installing the server is a simple as:

opam install menhir-lsp

The server alone doesn't do much, to do its job it needs a client that talks the LSP running in your editor. If you use VS Code proceed by installing the Menhir extension, then open an .mly or .mll document. The LSP client will launch the server and communicate with it automatically.

For other editors, please refer to their documentation on how to register a client.

Manual installation

Run these commands if the opam package is down or you want to hack on the server.

git clone https://github.com/dalps/menhir-lsp && cd menhir-lsp
opam install .

Development notes

The server's code depends on Linol, an OCaml package that simplifies the development of Language Servers.

It is also based on the source codes of both Menhir and Ocamllex, modified so their parsers stores location annotations in the AST and doesn't exit the server's process when a syntax error occurs.

Issues or PRs for missing features, clients for other editors or any bug / improvement are welcome.

License

GNU General Public License v2.0 only