-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
i'm unable to access javadocs #3619
Comments
Calling This indicates to me that this means the KafkaConsumer failing to get the docs might be unique to the way the Apache Kafka project is put together. |
Thanks, sorry for the delay, I had this pending to check out. enrich-classpath intentionally excludes some .jars. It could be that (which I intend to improve). It's useful that you reflect that you see it working for at least one case. Similarly the JDK should be an easy case. |
@vemv How does it choose which source jars to grab? Here is a link to the source kakfa jar that is currently not being downloaded, that i believe contains the javadoc: https://repo1.maven.org/maven2/org/apache/kafka/kafka-clients/2.8.0/kafka-clients-2.8.0-sources.jar I can download the sources for the kafka jar to my local repository using the mvn command line tool and it's plugin: This still doesn't result in cider inspect on the variable KafkaConsumer showing the docs, though they are definatly on my computer, i believe right next to the source files: e.g assuming i unziped the jar Shows the source file including the javadoc. |
I'd have to check it in detail. However if you explicitly add the ...there are exceptions, and neither Lein or t.deps support explicitly adding an item at the tail of the classpath. When a .java file is not at the tail, arbitrary issues can happen (I've seen them in various forms) which is why I don't generally advise the technique (and why the enrich-classpath tech has some detailed logic). But as a quick experiment, please do try it! |
Modifying my deps.edn to
and putting the dep in the corresponding folder:
then running cider-jack-in and evaling Not surprising, but I wasn't sure if anything would turn a .java file into a class file automatically. Adding the class files back in:
it will now eval (find the class), but I'm not exactly fixated on this particular package; i'm more curious if you think this is worth trying to improve. Assuming this is a real issue, and i'm not just barking up the wrong tree. I think currently, my solution to this kind of thing would be to use Intelliji, which, at a certain point of having to dive through Java code, I believe you're forced to do because it has so much more information available. E.g., number of references, etc.. But for emacs users, it would be nice to delay that step, as it comes with a heavy cost. |
Yes, you have to depend on the real dep and the source dep. (normally what enrich-classpath does is adding the source dep)
Best way to check it is to inspect the classpath. Or see if something like
I'm not sure what 'this' is. Things generally work for the JDK itself (documentation for You saw it working for another package in #3619 (comment) I also shared misc demos with you here https://clojurians.slack.com/archives/C099W16KZ/p1707539760278099 I can fix specific bugs (which are quite rare) but I'm not sure if you got a proper taster of the base tech. Without that, concrete bugfixes wouldn't make much of a difference for you. With all this said, I'll be happy to investigate Kafka in particular as time allows, which is why this ticket remains open 🤝 |
Expected behavior
I expect that running
cider-inspect
on the symbol KafkaConsumer will display the JavaDocs at the bottom of the cider-inspect buffer.Actual behavior
It doesn't, instead the cider-inspect buffer will correctly open and display everything (e.g interfaces, constructors, etc..) but the javadocs.
Steps to reproduce the problem
First set emacs variable
cider-enrich-classpath
tot
, then clone this repo, navigate within it using emacs to the file with KafkaConsumer , from that file runcider-jack-in
, then with your cursor on KafkaConsumer, runcider-inspect
, you should expect to see the cider-inspect emacs buffer to open, if you scroll the the bottom, you don't see the javadocs. In this case, it would be these docs. Which you can get to, as demonstrated here, from emacs using the clojure.java.javadoc/javadoc function if you add the right remote.Environment & Version information
CIDER version information
Include here the version string displayed when
CIDER's REPL is launched. Here's an example:
Clojure CLI version
clojure --version
Clojure CLI version 1.11.1.1413
Emacs version
GNU Emacs 29.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2024-02-11
Operating system
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
JDK distribution
[openjdk version "21.0.1" 2023-10-17
OpenJDK Runtime Environment Homebrew (build 21.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 21.0.1, mixed mode, sharing)H
Classpath of example project
The text was updated successfully, but these errors were encountered: