Ocaml-lsp find references in whole project?

OCaml modules can transport definitions or mask equality between components of modules.

Consequently, name resolution depends on the typing of the module system and local resolution information is not enough to get a global view of the project. (Also type-directed disambiguation implies that name resolution is done during typechecking of terms and not before).

You can read the PR linked previously, or the discussion in OCaml 4.14.0 is released - #2 by octachron that explains the issue in more details.

You can find a repository with steps to setup an environment with very early support for project-wide occurrences here: GitHub - voodoos/merlin-occurrences-switch

It is already outdated and many of the involved patches have evolved since this preview but it can already be played with and even be helpful in some cases :slight_smile:

4 Likes