Welcome! Please see the About page for a little more info on how this works.

0 votes
in CIDER by
edited by

With Emacs/Cider, what is the way to have local javadocs available? I would already be happy if I had the JDK javadocs.

When I "Press <C-c C-d C-d> to view the documentation for something (e.g. a var, a Java method)"

... with anything Java, I always get "Not documented. For additional documentation, see the Javadoc. Definition location unavailable."

I primarily use Windows and Java 18. But on Linux, I haven't seen it working either.

Among other attempts, I tried:

(use-package cider
   :custom
   (cider-enrich-classpath t)
   (cider-jdk-src-paths '("c:/opt/zulu18.32.11-ca-jdk18.0.2-win_x64/lib/src.zip"))
   ...)

This is all more confusing than helping:

https://docs.cider.mx/cider/usage/working_with_documentation.html#javadoc
https://github.com/clojure-emacs/enrich-classpath
https://github.com/clojure-emacs/cider/issues/930
https://bleepcoder.com/cider/315190809/cider-doesn-t-show-docs-for-java

1 Answer

+1 vote
by
selected by
 
Best answer

The way is (cider-enrich-classpath t), it's what is documented in https://docs.cider.mx which is our source of truth.

Note that it's disabled by default. It is because we found some last-minute issues which have to be solved (and will, soon enough).

cider-enrich-classpath t should work, for small-to-medium projects, using Leiningen.

If not, a detailed issue in the cider repo is much appreciated (please fill all fields carefully).

by
Thank you.

Thus, I could plug-in your middleware this way:

(cider-add-to-alist 'cider-jack-in-dependencies "mx.cider/enrich-classpath" "1.9.0")
(cider-add-to-alist 'cider-jack-in-dependencies "mx.cider/tools.deps.enrich-classpath" "1.9.0")

It worked for me on Windows with Leiningen, once the Maven repo had been moved to C:\repo (a shorter path than the default one). Otherwize, Java would complain about ProcessBuilder being given too long args.

With tools.deps I had no success.
...