merlin icon indicating copy to clipboard operation
merlin copied to clipboard

Eldoc support in Emacs

Open bbatsov opened this issue 2 years ago • 7 comments

I'm curious if there's any reason not to support directly eldoc-mode in merlin-mode, as from what I gather from https://github.com/Khady/merlin-eldoc all the necessary information is available there.

What's the recommended way to get type signatures in Emacs these days?

bbatsov avatar Jun 21 '22 07:06 bbatsov

I originally considered opening a PR for the inclusion of merlin-eldoc directly inside merlin. But kept it appart to limit the maintenance burden on the merlin authors (who aren't emacs users themselves). If the situation has changed I'm fine with moving the code here and archiving my repo.

Khady avatar Jun 21 '22 08:06 Khady

I'm not an OCaml expert, but I know a thing or two about building Emacs packages and I think basic functionality like Eldoc should be bundled with development environments like Merlin. Plus, already the package has extensions about all sorts of things and eldoc is basic built-in machinery.

When I've started to play with OCaml I was a bit frustrated that I need to figure out how several packages interact with one another (utop, tuareg, merlin, merlin-eldoc, etc), compared to what I'd do with Clojure and CIDER - I just install CIDER and everything is there. Separately maintained packages tend to introduce inconsistencies and might occasionally go out of sync as well).

If more Emacs maintainers are needed for merlin.el - I'd be happy to help. I already noticed that Merlin doesn't quite follow the modern Emacs development practices. I just have to learn a bit more OCaml along the way. :-)

bbatsov avatar Jun 21 '22 09:06 bbatsov

So, do we have consensus that we should merge merlin-eldoc in the main Merlin package?

bbatsov avatar Jul 24 '22 13:07 bbatsov

@bbatsov I think a PR would be the fastest way to make progress on this :) Personally it seems a good idea (especially as it is opt-in: it can be enabled/disabled by toggling eldoc-mode, right?)

nojb avatar Jul 24 '22 14:07 nojb

Yeah, that's just a matter of turning on/off eldoc-mode or removing the setup function. Basically my idea is to just copy the existing merlin-eldoc package inside the merlin repo and add it to the main package manifest there.

Btw, who are the Emacs package maintainers these days? I guess we need their blessing as well.

bbatsov avatar Jul 24 '22 14:07 bbatsov

if it goes through, there's probably some work necessary to help emacs distributions transition. For example spacemacs is shipping merlin-eldoc from my repo.

Khady avatar Jul 25 '22 03:07 Khady

That shouldn't be a big deal - we can keep the old package as some placeholder that just requires merlin (+ a deprecation warning) and the name of the setup function will remain the same. If you have two of them installed that shouldn't be an issue for most people either.

bbatsov avatar Jul 25 '22 06:07 bbatsov