Fork me on GitHub
#cider
<
2019-11-10
>
David Pham08:11:08

Can we get the same behavior with Cider? https://i.redd.it/sgef9jhbiax31.gif

calva 2
bozhidar08:11:48

Where is this from?

David Pham23:11:16

It is from VSCode and Calva @bozhidar

dpsutton17:11:09

(defun cider--tooltip-show ()
  (interactive)
  (if-let ((info (cider-var-info (thing-at-point 'symbol))))
      (nrepl-dbind-response info (doc arglists-str name ns)
        (pos-tip-show (format "%s : %s\n%s\n%s" ns name arglists-str doc)
                      nil
                      nil
                      nil
                      -1))
    (message "info not found")))

(bind-key "C-c t" 'cider--tooltip-show)
didn't realize this would be so easy

🔥 2
justinbarclay19:11:27

This is very nice and I am stealing it for my config, thanks!

dpsutton17:11:31

popup with docstring info

pez17:11:19

I though CIDER showed signature help in the minibuffer?

dpsutton17:11:30

it does. but that doesn't show the docstrings. this does a little popup with docstring inline

dpsutton17:11:42

which i want but doesn't exist currently as far as i know

dpsutton17:11:58

there's cider-doc but that creates a new window which is often a bit heavier than i want

pez17:11:07

Yeah, it’s very nice. Just got the impression that it was an answer to @neo2551’s question. 😃

dpsutton17:11:05

ah i didn't intend that to be. just something i've wanted for a while

pez17:11:44

I think that tooltip should be included with Cider.

dpsutton17:11:04

i have pos-tip in my emacs but not sure if @bozhidar is open to taking on a new dep

bozhidar08:11:49

I’m open to adding something like this, but we have to be careful for it not to affect the existing tooltips. (they are currently shown on mouse hover) I guess if this is enabled they should become disabled or something along those lines. A few people requested similar behaviour over the years, but it wasn’t high on my todo list and no one was willing to tackle it. This can also be useful for something like pretty-print at point.

pez17:11:32

Ah, didn’t realize. But, still, very handy thing to be able to pop up at demand like that.