rocq-lsp-client

October 22, 2025 ยท View on GitHub

An OCaml library for programmatic communication with the rocq-lsp language server.

rocq-lsp-client lets you start a coq-lsp process from OCaml code, send LSP commands (e.g. textDocument/hover, textDocument/didOpen), and receive structured responses.


๐Ÿš€ Overview

This library provides a lightweight LSP client implementation specialized for rocq-lsp (the Coq language server). It is intended for tools or research projects that need to interact with Coq via LSP without relying on an editor.

Internally, it:

  • spawns a rocq-lsp process,
  • communicates using JSON-RPC 2.0 via stdin/stdout,
  • and provides OCaml functions for sending requests and parsing responses.

โš™๏ธ Requirements

Before using this library, make sure that:

  • The rocq-lsp executable is installed and accessible in your $PATH.

You can verify this with:

$ rocq-lsp --version

If the command is not found, install it from the rocq-lsp repository

๐Ÿ› ๏ธ Installation

You can build and install this library using Dune

$ dune build
$ dune install

๐Ÿงฉ Usage Example

see [sample/main.ml]