merlin
merlin copied to clipboard
Tracker: project-wide occurrences
Initial support for project-wide occurrences (PWO) will be added to Merlin starting with release 5.1-502.
It is a large-scope feature that involves patches to multiple projects and majors changes to Merlin internals. This issue aims at gathering feedback and keeping track of progress, issues and feature requests related to this feature.
Features
- [x] Dune rules to drive
ocaml-indexand build project indexes. (ocaml/dune#10422 and ocaml/dune#10623) - [x] Return all usages of a value along with its definition. (ocaml/merlin#1766)
- [x] Basic support in the VIM plugin. (ocaml/merlin#1767)
- [x] Basic support in the Emacs plugin. (ocaml/merlin#1766)
- [x] Support in the
ocaml-lsp-serverfrontend. (ocaml/ocaml-lsp#1233) - [x] Release of
ocaml-index.1.0. (voodoos/ocaml-index) - [x] ⭐ Release of
merlin.5.1-502with initial support for project-wide occurrences - [x] ⭐ Release of
ocaml-lsp-serverwith initial support for project-wide occurrences https://github.com/ocaml/opam-repository/pull/26114 - [ ] Return all declarations associated to the value definition.
- [x] Distinguish between interfaces and implementations uids.
- [ ] 🏗️ Improve location information for longidents.
- [ ] Index indirect usages of modules in paths such as
M.N.x - [x] ⭐ Provide a renaming engine based on occurrences results.
Known issues:
- [x] The actual unit name might be wrapped by the build system. Merlin should be made aware of it. (ocaml/merlin#1776)
- [x] Uid are not stable when retyping the buffer (#1779)
- [x] Result might mix uids from implementation with interfaces (#1781)
- [x] Improve the behavior on occurrences when on a label / constructor declaration (#1785)
- [ ] All occurrences of values defined in functor are returned, but often restricting to a specific instantiation would be more useful.
- [ ] PWO does not work with definitions coming from a module without an implementation
- [ ] PPXes, especially the ones that do not respect the
ghost nodes/merlin.hideconventions might lead to unexpected behavior. - [ ] Punned record field are considered a value by Merlin, not a label.