Fork me on GitHub
#emacs
<
2015-08-28
>
sashton01:08:10

When I try 'M-x cider-jump-to-var' on Java classes, I just get: "No source location". In this case I was trying to navigate to clojure.lang.RT. Is there something I'm missing?

roberto01:08:31

the source ?

sashton02:08:50

Do I have to attach the java source manually? If so, how is that done? I'm coming from intellij which will do it automatically for clj and java sources

roberto02:08:32

yeah, not sure. Maybe it is done by specifying it in the deps. I have never tried to navigate to java source, so I’m speculating.

roberto02:08:02

btw, if you have access to intellij, I would recommend using cursive.

roberto02:08:09

you would be much more comfortable there

sashton02:08:24

i've used it for a while, but wanted to try out emacs

roberto02:08:41

I would guess you have to tell lein to include the source

roberto02:08:45

not sure how that is done

roberto02:08:14

:java-source-paths

roberto02:08:17

you need to add that

roberto02:08:27

defproject my-project "0.0.1-SNAPSHOT"
  [...]
  :java-source-paths ["src/java" "test/java”])

sashton02:08:44

but for a dependency like clojure.jar?

roberto02:08:45

from the lien docs:

For projects that include some Java code, you can set the :java-source-path key in project.clj to a directory containing Java files. Then the javac compiler will run before your Clojure code is AOT-compiled, or you can run it manually with the javac task.

roberto02:08:55

i would think it also applies

roberto02:08:08

you would need to download the source jar, and put it in your source path

roberto02:08:19

I would try that and see how it works