Fork me on GitHub
#cider
<
2023-03-12
>
Akiz09:03:50

Hi, is there any way how to completely disable cider on-hover documentation? When i am runing eglot and cider, i still get cider documentation in echo area.

bozhidar09:03:45

@zikajk Do you mean the eldoc documentation?

bozhidar09:03:19

The eldoc for the symbol at point can be disabled, but for the rest you'll need to stop eldoc completely or remove CIDER's hook from ElDoc:

(remove-hook 'eldoc-documentation-functions #'cider-eldoc)

Akiz10:03:47

Thank you, I’ve tried this as well but I am still getting it. https://www.loom.com/share/da8dbe7359fd47beb0cb4d8df0db2350 Edit: sorry for the kids in the background 😄

bozhidar10:03:42

It has no effect because it's not coming from CIDER. 🙂

bozhidar10:03:11

I'm guessing this is the ElDoc format that eglot or clojure-lsp are using, but CIDER's ElDoc messages look differently.

Akiz10:03:35

I disabled Eglot and you can see that I dont get this messages until i start Cider.

bozhidar10:03:47

Might be best to just check what exactly do you have in eldoc-documentation-functions.

Akiz10:03:19

eldoc-documentation-functions is a variable defined in 'eldoc.el'.

Its value is nil

bozhidar10:03:55

Seems that's not eldoc then, but some on mouse hover functionality.

bozhidar10:03:31

Are you running Emacs in a terminal?

Akiz10:03:29

No… I don’t. Hm, then I will dig deeper. I just disabled all modes and I still get it 😄

Akiz10:03:00

Until i close REPL, then it dissapears

bozhidar10:03:03

If so try setting cider-use-tooltips to nil, but this showed the help in an overlay.

bozhidar10:03:10

That's how those on-hover tooltips look for me

bozhidar10:03:51

But if you're using some heavily customized Emacs distro god knows what settings were changed there. 😄

Akiz10:03:33

Ha, disabling cider-use-tooltips is the way! Thank you.

Akiz10:03:54

I am ussing Vanila Emacs btw.

bozhidar10:03:26

By default this shouldn't go to the minibuffer IMO, as this was somehow tied with help-echo.

Akiz10:03:55

If I ever find the time, I’ll try to replicate it, find out where the problem is. Thanks again for your help.

2
Akiz12:03:35

I got it, i had disabled tooltip-mode and so every tooltip was displayed in echo area (which I learnt just now ;-))

Akiz14:03:09

And because I like CIDER’s ElDoc messages quite a lot I am using this hook on cider-mode.

(defun my/remove-eglot-eldoc-from-cider-buffers ()
          (remove-hook 'eldoc-documentation-functions #'eglot-hover-eldoc-function)
          (remove-hook 'eldoc-documentation-functions #'eglot-signature-eldoc-function))
(I suppose that having fewer fns in eldoc-documentation-functions might help a performance little bit? Otherwise, it is not needed)

bozhidar05:03:58

The ordering of the functions there matters (the first that returns something is the one to provide some result), That’s why it’s not a bad idea in my book to be more explicit here if you already know which function you want to use all the time.

bozhidar05:03:56

Generally this ordering has always been somewhat frustrating to me as it’s a bit random and people have to be aware of it (tools can force the ordering priorities, but this might be weird for the end users as well).

👍 2