BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.64k stars 214 forks source link

Doc string from "dynamic interned vars" is not shown in completion details #2552

Open behrica opened 4 months ago

behrica commented 4 months ago

If I define a var and its doc string dynamically:

(intern 'clojure.core
          (vary-meta
           'test123
           assoc
           :doc "doc of test")
          (fn [a b c]
            (+ a b c))
          )

and the try to complete it via

(clojure.core/test1...)

then VSCode / Calva does not render the doc string in the completion details. (only the args are shown) while it does so for other vars in clojure.core.

Description with screenshots is here: https://app.slack.com/client/T03RZGPFR/CBE668G4R

behrica commented 4 months ago

It does work for "hover" over the var, there the doc string is shown, only missing while completing.

behrica commented 4 months ago

we would like to have this working due to tghis work ongoing: https://github.com/scicloj/clojisr/pull/98

This would render the "help" of "R functions" expressed as Clojure vars. It does work in Emacs.

PEZ commented 4 months ago

Yeah, it's intended to work.

behrica commented 4 months ago

One different between "hover logic" and "completion logic" is this:

if (util.getConnectedState())

vs

if (util.getConnectedState() && item['data']?.provider === 'repl') {

behrica commented 3 days ago

any new on this ?

PEZ commented 3 days ago

Hello. I had completely forgotten about this. I'm sorry!

Now checked and from what I can see we do have the docs in the results from nrepl, but we somehow bork it in our InfoParser. Here's the call:

https://github.com/BetterThanTomorrow/calva/blob/published/src/providers/completion.ts#L111

I don't think it should be too hard to fix. Do you want to have a go at it? Otherwise I will get to it some day soon.