ocaml / merlin

Context sensitive completion for OCaml in Vim and Emacs
https://ocaml.github.io/merlin/
MIT License
1.57k stars 233 forks source link

Merlin-lib: return the description of a warning based on its identifier #1775

Open xvw opened 3 months ago

xvw commented 3 months ago

In order to make https://github.com/ocaml/ocaml-lsp/issues/717, we'd like to add a function to merlin-lib.util to retrieve the description of a warning. The warnings are already located here: https://github.com/ocaml/merlin/blob/master/src/ocaml/utils/warnings.ml

PizieDust commented 3 months ago

Merlin has a command syntax-doc that returns information about certain syntax. I wonder if this will be a good use case for this issue given that we want to return information about the warning to the user. To do so, a good place to start will be to include the description we want here: https://github.com/ocaml/merlin/blob/master/src/analysis/syntax_doc.ml This way, when the user has the syntax-doc feature activated on their editor, they will be able to see the description each time they hover on the warning.