Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@ Opam allows you to install packages either locally (in the current switch) or gl
$ opam install ocaml-lsp-server
```

##### Using Dune

If you are using [Dune for package
management](https://dune.readthedocs.io/en/stable/explanation/package-management.html)
on the [latest nightly build](https://preview.dune.build/) or version 3.21 or
later, you can install `ocamllsp` locally within the current project by
running:
```bash
$ dune tools install ocamllsp
```

This will compile `ocamllsp` with the same OCaml compiler as the project itself -
a requirement for `ocamllsp` to be able to analyze the code in the project.

To make sure Neovim launches the project's local instance of `ocamllsp`, run
`eval $(dune tools env)` from your shell before launching Neovim from the same
shell. This can be automated by adding `eval $(dune tools env)` to a `.envrc`
file in the project's root directory and using [direnv](https://direnv.net).


##### From source

```bash
Expand Down