package menhir-lsp
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=171448c5fedfdcc7757c78b04659b353
sha512=e1235c0646e6753ff18a77b1ff443abfba118efce3ee7dfaa66c45ebf8483dc804a8864db493fc0168b4f66b9721efcdf87733fa15bbe03c1e5a2a8bd6e5961d
doc/README.html
LSP implementation for Menhir grammars
menhir-lsp is a Language Server for Menhir, an LR(1) parser generator developed by Inria. The server offers basic IntelliSense features for Menhir grammars (files with the .mly extensions) requested by a client hosted in a text editor. A client for VS Code is conveniently provided as a VS Code extension.
Features
Requests handled by the server:
- Find References - with token alias resolution
- Goto Definition Request
- Hover
- Document Symbols
- Completion for terminals, nonterminals and standard library rules.
Usage
Installing this server is a simple as:
opam install menhir-lspThen, in order to get IntelliSense for your grammars in VS Code, you need to install the client, available in the VS Code Marketplace. The client will run and communicate with the server automatically.
Development & contributing
The server code is based on the Linol Lwt template.
It also reuses the Menhir grammar that parses Menhir itself to get an AST representation of the document annotated with locations. I've tried working with the Menhir SDK, but the cmly representation of the grammar doesn't have location annotations for the various symbols, which are essential in implementign most LSP features, so vendoring the original code is the best I could come up with.
Please open an issue or a PR for missing features, ideas for improvement, other editor support, general bugs or any other matter.
License
GNU General Public License v2.0 only