ocaml/ocaml-lsp ↗
Created Jan 9, 2021 · View the ocaml/ocaml-lsp repository page
OCaml Language Server Protocol implementation
Want this for your repo?
Render a free sample of any GitHub repo in seconds.
Contributors
41
Lines of Code
2,861
From
Jan 28, 2019
To
Jan 3, 2021
About ocaml/ocaml-lsp
OCaml-LSP is an implementation of the Language Server Protocol for OCaml that enables IDE integration and editor support for OCaml development. The project provides the `ocamllsp` binary, which allows text editors and IDEs to offer features like code completion, hover information, go-to-definition, refactoring, and diagnostics for OCaml code. It can be installed via opam, esy, or Dune's package management system, and integrates well with the Dune build system through RPC communication.
The server supports a comprehensive range of LSP features including semantic highlighting, document formatting, code lensing, symbol navigation, and renaming. Beyond standard LSP capabilities, OCaml-LSP provides OCaml-specific extensions such as switching between implementation and interface files, inferring interfaces, locating typed holes, and generating exhaustive pattern matching through code actions. The project also includes experimental features for constructing values by type and displaying syntax documentation on hover.
OCaml-LSP is particularly well-integrated with the Visual Studio Code platform through the OCaml Platform extension, though it works with any LSP-compatible editor. The project vendors Merlin internally to provide "smart" functionality even when source code doesn't compile, eliminating the need for users to separately install Merlin. Development is active with comprehensive test coverage and a changelog-driven contribution process.

