New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CIDER doesn't show docs for Java #2269
Comments
As you see, the symbol is also mistakenly resolved for java.lang.Character/toUpperCase instead of lang.String. |
Don't you get a prompt asking you which version to choose? |
@bbatsov Strangely, today it is like this (which is much better 😂): I checked, and I do get the prompt when I use the default hotkey (In Spacemacs it is
This hotkey somehow skips the prompt and just shows the docs for character. BTW, eldoc's hint could also use some work, e.g., a separation between the args of the different methods: |
We could not figure out a good separation, that's why we just mixed the signatures of all possible versions. It's ideal, but unfortunately I can't see how this can be improved either. Eldoc must have a ver string structure, otherwise the highlighting of params there would break. |
@bbatsov I just restarted my Emacs, and the Javadocs went missing again. :( |
I wonder if things change for you if you try Java 8 instead of 9. I haven't had much time to play with Java 9 and I wonder if some of the classpath manipulation that we do is not working properly there or something. Also - make sure the code buffer has been evaluated before trying eldoc/cider-doc). |
@bbatsov I switched to Java 8, and still haven't had any issues (but I haven't done much coding since so who knows). |
Haha! And I thought this was my happy face! 😄 |
Hi, (emacs/cider beginner here) Where in the general cider/ROADMAP is this bug positioned ? Is it more
Everytime I spend some time learning clj/emacs I end up wanting to lookup some Class and get frustrated - which is entirely on me, but I keep asking myself: Is my setup wrong or broken, or do "real" clojure devs never need to lookup a javadoc - which would be quite baffling to me. My testcase is to lookup via In short: Is this just broken for me or for everybody and how do people cope without ? PPS: i have tried with java 8 - 11 with java-doc and java-src installed Outputs: on a class
on a method
|
Progress ! I think the following is happening Premise: I use spacemacs, which uses cider from MELPA , currently 0.20.0 + cider-nrepl 0.20.0 cider-nrepl 0.20.0 uses orchard 0.3.1 Issue: orchard detects java sources by means of
(https://github.com/clojure-emacs/orchard/blob/v0.3.1/src/orchard/java.clj#L47) On my system (archlinux) and in ubuntus i.e.
or archlinux
in an demo emacs/cider repl
I do not know if something from outside passes this in , or if its the current java's default home. if I'm not mistaken that would mean on my system jdk-root is
resulting in Conclusion:
Does that help anyone ? |
Yes, it helps! Through java 8, the
From java 9 onwards, the JRE subdirectory is gone and its contents are merged up one level into the JDK root, which
(see https://docs.oracle.com/en/java/javase/11/install/installed-directory-structure-jdk.html) As an aside for users of Debian-derived distros, the
It seems like orchard should check in both places and test whether In the meantime, you can find your copy of |
hm, it seems that the call chain I forced the zip on the classpath by means of project.clj
and checked via
still no doc |
It looks like this'll be broken on Java 11 until clojure-emacs/orchard#20 is fixed. (clojure.java.io/resource "java/util/AbstractQueue.java")
;; => #object[java.net.URL 0x2e00bc76 "jar:file:/usr/lib/jvm/java-8-openjdk-amd64/src.zip!/java/util/AbstractQueue.java"]
(require '[mranderson049.orchard.v0v4v0.orchard.java.parser :as ojp])
(keys (ojp/source-info 'java.util.AbstractQueue))
;; => (:class :doc :line :column :members :file :path) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding! |
@jeffvalk recently addressed the linked Orchard issue, so I guess we can close this one. |
On Debian 10, all I had to do was install |
On Ubuntu 18.04 with Emacs 26.3 CIDER 0.24.0 nREPL 0.6.0 Java 1.8.0_242 I added a dir containing a zip with Java sources as a resource to Leiningen profile (
|
Expected behavior
Actual behavior
Environment & Version information
CIDER version information
;; Connected to nREPL server - nrepl://localhost:59990
;; CIDER 0.17.0snapshot (package: 20180413.51), nREPL 0.2.13
;; Clojure 1.8.0, Java 9.0.4
Lein/Boot version
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.8.0
BOOT_VERSION=2.7.2
Emacs version
27.0.50
Operating system
macOS
The text was updated successfully, but these errors were encountered: