package menhirformat
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=d575405f1bdecf528165735637e3f130
sha512=3b4b3e5461c38a20f204a0a23781c31a6271cc06df803737c8861d3be81e614b855a13385fb9911b7c9f4d46c9950e0a90dd7f5e7b92598e63fea171347d0ea0
doc/README.html
Menhir LSP
menhir-lsp is a Language Server for the OCaml dialects Menhir and Ocamllex. Its goal is to provide first-class language support for their syntaxes in client editors. A client for VS Code is available through a VS Code extension.
Capabilities
Installation & Usage
Install the server through opam:
opam install menhir-lspThe server alone doesn't do much, to do its job it needs a client that talks the Language Server Protocol running in your editor. If you use VS Code proceed by installing the Menhir extension, then open a document with the .mly or .mll file extension. The LSP client will launch the server and communicate with it automatically.
For other editors, please refer to their documentation on how to register an LSP client.
Manual installation
Run these commands if you encounter a problem with the opam package or you'd like to hack on the server:
git clone https://github.com/dalps/menhir-lsp.git && cd menhir-lsp
dune installYou can also download a copy of the binary from the lateset release on GitHub. Put it under a folder that's included in your PATH and the client should be able to run it as well.
Development
The server's code lives in the bin directory. It relies on Linol, an OCaml package that simplifies the development of Language Servers, and the visitors OCaml syntax plugin, for automating AST traversals.
It is also based on the original codebases of both Menhir and Ocamllex, whose parsers I modified in order to annotate their ASTs with source locations and make error recovery possible.
Additional references: ocaml-lsp, atd-lsp, catala-lsp. These were huge help material for implementing common LSP tasks in OCaml.
Editor support
Currently only VS Code is supported, but not everyone uses VS Code. If you think this is useful and would like to have menhir-lsp work in your preferred editor, please consider contributing a new client / extension / adapter through a PR. I'm planning to maintain only the VS Code client since that it is my daily editor.
Issues for bugs / missing features are welcome.
License
GNU General Public License v2.0 only