Fork me on GitHub

I think that’s fundamentally how cider works. It is part of of running image and doesn’t do any static introspection. Until you evaluate forms it only knows about clojure core essentially.


@dpsutton It seems I didn't explain clearly. My test was on the slurp function, so not working on clojure.core functions. I don't need to evaluate anything specific, but it seems I need to evaluate something before any function will work with clojure-doc. If it should work on clojure.core, I will do more testing on other core functions. I understand that my own custom functions should be evaluated before Cider can find them.


@marques.goncalves.fel The following works deps.edn file will jump to Java definitions using the CIDER command clj-find-var . I have a deps.edn as follows:

 ["src" "resources"]

 {org.clojure/clojure {:mvn/version "1.10.1"}

  ;; Java 11 sources
  java-sources {:local/root "/usr/lib/jvm/openjdk-11/lib/"}}}
The location of your file may differ. I installed the sources from an Ubuntu package openjdk-11-source . I would recommend adding the Java sources as an alias, rather than a main dependency.


@marques.goncalves.fel I've added example aliases for including java sources in my example deps.edn file here: I would encourage you to use aliases rather than including sources as a main dependency, as the java sources are a development time artifact.

   {java-sources {:local/root "/usr/lib/jvm/openjdk-11/lib/"}}}

Felipe Marques19:03:11

Thanks for the amazing explanation. Normally, I don't have to look the java source code. But recently I have been working with Avro and it is handy to be able to take a look at the library from inside Spacemacs. But now I understand better the internals and how I could make it available. Thanks!


Its useful stuff for the Spacemacs book I am writing, so I was happy that I managed to figure out how to do it. Occasionally I do a bit of Java Interop, so it is useful to have for those times. Now I know how to do it next time I forget 🙂

Felipe Marques11:03:24

Cool! Btw, I love you book. I use Spacemacs and it was my go-to reference when I was starting (and it still is!)


If you always want to include the java sources when running cider-jack-in then you can add a .dir-locals.el file to the root of your Clojure project. Here is an example that will include the java-11-source and use the clojure-cli buld tool by default (if you have more than one build configuration file)

((nil . ((cider-clojure-cli-global-options . "-A:java-11-source")
         (cider-preferred-build-tool . "clojure-cli"))))


In case there are any nREPL experts in the house, I could use a little help with It doesn't work with lein and boot yet. Somehow the response is not printed


@U04V15CAJ just a casual perusal, but I see you're casing on the op code as a keyword. I thought these are always strings. If you don't match anything in the session loop you stop there. Strange to only see a recur in the eval branch


and i see the following in nrepl server:

(defn- normalize-msg
  "Normalize messages that are not quite in spec. This comes into effect with
   The EDN transport, and other transports that allow more types/data structures
   than bencode, as there's more opportunity to be out of specification."
  (cond-> msg
    (keyword? (:op msg)) (update :op name)))