Page
Library
Module
Module type
Parameter
Class
Class type
Source
menhir-lsp is a Language Server for the OCaml dialects Menhir and ocamllex. Its goal is to provide rich IntelliSense features in .mll and .mly files. A client for VS Code is available as a VS Code extension.
Installing the server is a simple as:
opam install menhir-lspThe 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 spawn the server and communicate with it automatically.
For other editors, please refer to their documentation on how to register a client.
Run these commands if the opam package is not working or you want to hack on the server.
git clone https://github.com/dalps/menhir-lsp && cd menhir-lsp
opam install .The server code is based on the Linol Lwt template.
It also reuses the Menhir grammar that parses Menhir itself to get the AST representation of the document annotated with locations. Unfortunately the AST offered by the Menhir SDK lacks location annotations for various kinds of symbols, so I had to resorted to tweaking the original parser to get things working.
Issues or PRs for missing features, clients for other editors or any bug / improvement are welcome.
GNU General Public License v2.0 only