Closed expez closed 5 years ago
Likely the source jar is not on the classpath.
Likely the source jar is not on the classpath.
This happened with org.joda.time.Period
IIRC. Does it not work because that jar is pulled in by clj-time
?
Probably. It likely pulled just the compiled classes, but you also need the source jar for source lookup to work.
Btw, you shouldn't be getting an error, but some message saying the source can't be found. That's odd...
I tested this and got a No source location
message (as expected). Maybe we can improve this message a bit...
Is there a known workaround for this? I have manually built and installed maven project which contains both source and javadoc jars. CIDER cannot locate neither source nor javadoc.
Just found a rudimentary workaround by manually adding jar files to lein's :resource-paths.
Guess we can close this then. Unless someone wants to contribute some documentation on the subject?
I'll have to get up to speed but I can do it tomorrow
On Oct 8, 2016 12:25 PM, "Bozhidar Batsov" notifications@github.com wrote:
Guess we can close this then. Unless someone wants to contribute some documentation on the subject?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/clojure-emacs/cider/issues/1666#issuecomment-252437249, or mute the thread https://github.com/notifications/unsubscribe-auth/AGFPTcAUxsuCmd54yxLRvm52RN-uHxqGks5qx9IUgaJpZM4IFO1w .
@dpsutton Sounds good.
I've been trying to figure this out. I've built a project mvn install
and then referenced it. I got no errors, just info that no documentation was found when trying to view docs. @vspinu can you help shed some light on circumstances that could trigger an error?
I think a larger point is that we haven't documented at all how one can add source jars to their lein/boot project.
@vspinu I tried adding paths to jars in :resource-paths
and I still can't jump to the java source nor view its documentation. What did you do?
Just that, added full paths to the :resource-paths
:resource-paths ["/home/vspinu/.m2/repository/com/interactivebrokers/tws-api/9.71.1/tws-api-9.71.1-sources.jar"
"/home/vspinu/.m2/repository/com/interactivebrokers/tws-api/9.71.1/tws-api-9.71.1-javadoc.jar"]
Did the trick for me, both for refs and javadocs.
Documenting this is just passing the ball to the user. How hard would it be to check for -sources.jar
or-javadoc.jar
and add them to the classpath dynamically?
Thanks, the mistake was mine, I added the wrong jar (with only .class
files).
It would be easy to check for jars, but where would we check?
but where would we check?
In the parent directory of the class jar.
The trick with :resource-path
no longer works. Has something changed in the java-ref lookup in the past 7 months or so?
I now see a lot "bad source file" errors like this when I first call cider-find-var
:
bad source file: /home/vspinu/.m2/repository/io/netty/netty-transport/4.1.22.Final/netty-transport-4.1.22.Final-sources.jar(io/netty/channel/ChannelFactory.java)
file does not contain class io.netty.channel.ChannelFactory
Please remove or make sure it appears in the correct subdirectory of the sourcepath.
If I check manually I do see an interface ChannelFactory
in that java file.
Another simple workaround for this is to use tags instead
## fetch sources and javadocs
lein pom
mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc
## build tags
mkdir java-sources && cd java-sources
jar -xvf ~/.m2/repository/io/netty/netty-all/4.0.23.Final/netty-all-4.0.23.Final-sources.jar
ctags -eR
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!
The trick with :resource-path no longer works. Has something changed in the java-ref lookup in the past 7 months or so?
@jeffvalk is our resident expert here. I don't recall any changes in this area for quite a while until very recently. It still seems to me that the only thing needed for the lookup to work should be for the source artifacts to be on the classpath.
Is this still an issue? If the source is on the classpath, info
should work for java sources. The JDK sources are added to classpath by Orchard. Anything else, the user would need to add in project.clj
, etc.
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!
This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.
Not entirely sure what's special with
Period
. Jumping to e.g.java.lang.Exception
works fine. Perhaps it's that it's in a jar.