alexander-yakushev / compliment

Clojure completion library that you deserve
Eclipse Public License 1.0
355 stars 38 forks source link

Doc of ns via alias #93

Closed eval closed 1 year ago

eval commented 1 year ago

Is this something that we want to support?

user=> (compliment.core/documentation "clojure.set")
"clojure.set\nSet operations such as union/intersection.\n"
user=> (require '[clojure.set :as cset])
nil
user=> (compliment.core/documentation "cset")
""
vemv commented 1 year ago

I tried in my CIDER just now and I can type se<TAB>, see the Compliment-powered widget pop up, and see the clojure.set documentation:

image

Probably there's some translation step at the CIDER level before passing things to Compliment?

Anyway, does that work in your machine? (Assuming you use Compliment in a similar fashion)

eval commented 1 year ago

I use compliment to enhance (the vendored) rebel-readline in deps-try.

But I also checked in CIDER, and thought it was not working but that was a jack-in using bb. Via clojure it works indeed.

alexander-yakushev commented 1 year ago

I don't see a reason why not. There could be some minor annoyances where the namespace alias matches one of the vars, and I think in that case the doc will contain both of them. But given that namespace docstrings are quite rare anyway, it shouldn't be a big problem. Looking forward to a PR!