-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Allow jumping to java source when the jar is already avaible in classpath. #607
Conversation
Oh this looks like a great change! Thank you very much! The only issue here isn't your fault, we're in the middle of a project wide refactor over on the If you don't want to jump through those hoops I'm happy to make the change on your behalf. I just want to give you the chance to make the actual commit and own it rather than just having a mention from me in a commit 😃 I also worry having nfnl installed will be a barrier to contributors so I might need a script people can run to compile a file without it as well... |
Wait... This PR is already targeting |
Ah! My apologies! I had a very long day and thought the makefile change signaled master I think. I'll get this merged ASAP |
Hmm trying to test this out locally, do you know which kind of symbols this should help with? Because I think I can't see a difference in behaviour between I think I've ben trying to jump to core Java files which just print the URL of the docs online rather than jumping to source. I'm at Heart of Clojure this week so a little busy but will try to get it confirmed and merged. Thank you for the effort and sorry for not reading the PR carefully enough the first time. |
Yes exactly. This can be easily done with clojure-emacs/enrich-classpath. I think any java symbol should do. |
So I've tried this out on ; Can't open source, it's Java
; cider/enrich_classpath/Calc72.html Swapping trains now, will take another look in a sec! Finally on my way back from Heart of Clojure and I want to get to the bottom of this and get it working if I can :) not sure if this change itself changes things for me, but maybe there's something more we can do that will get it working. |
Because we can only open the Java if it's on disk right? If it's not we just get the doc HTML URL from CIDER I think? I'll use debug mode and inspect some of the messages for what we have available. Here's the full debug output when looking up this symbol: ; --------------------------------------------------------------------------------
; def (word): Calc72
; debug: send
{:id "04334167-fc2c-4c9e-b86e-9e02d6f55104"
:ns "dev.sandbox"
:op "info"
:session "c230ae99-24d1-4a03-91f5-6463feaa35e6"
:symbol "Calc72"}
; debug: receive
{:class "cider.enrich_classpath.Calc72"
:id "04334167-fc2c-4c9e-b86e-9e02d6f55104"
:interfaces {}
:javadoc "cider/enrich_classpath/Calc72.html"
:modifiers "#{:public}"
:name "Calc72"
:package "cider.enrich_classpath"
:session "c230ae99-24d1-4a03-91f5-6463feaa35e6"
:status ["done"]
:super "java.lang.Object"}
; Can't open source, it's Java
; cider/enrich_classpath/Calc72.html So we don't get a Java file path, we do get some HTML but that's not super useful I guess 🤔 we get the same on either branch. |
OH! I have to somehow use enrich-classpath in order to pull the Java sources that I can then set up Conjure to access. This is harder than I thought and the integration seems a little involved. Still thinking about it though. |
Okay, I'm going to merge this even though in my setup I have no |
Would someone mind writing up what steps you need to go through to get this working? 🙏 |
I think it's well documented in the class path enhancer project mentioned
above. I haven't tried it, but it involves setting up a makefile and
launching your REPL in a particular way.
Not something I'm willing to delve into for the 1-2 times a year I need to
peek at java source 😅
…On Fri, 20 Sept 2024, 16:28 Oliver Marshall, ***@***.***> wrote:
Would someone mind writing up what steps you need to go through to get
this working?
—
Reply to this email directly, view it on GitHub
<#607 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACM6XLWDDEH25TI6WO6XDTZXQ5JBAVCNFSM6AAAAABOIHV73GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRTHE4TANZRGM>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
This improves and potentially fixes #142. I haven't done thorough testing though.
In my experiment with clojure-emacs/enrich-classpath setup, the
info
includesjavadoc
,file
andline
, then without returning early forjavadoc
, it can actually jump to java file correctly.Example log of running def_word on java symbol:
I assume there's no good reason to early return for special-form either.