This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Playing with enrich-classpath
, I dont get the JDK sources recognized.
Doing this : (-> Thread class->source println)
as documented returns nill
The "classpath" looks good and seem to contain a directory with the unpacked java files:
/home/vscode/.cache/mx.cider/unzipped-jdk-sources/11021
The contents of this directory is again a folder structure:
java.base
java.compiler
java.datatransfer
java.desktop
...
and the the folder java.base
contains the source of class Thread
But somehow class->source
does not find it.This is interesting:
user=> (io/resource "/home/vscode/.cache/mx.cider/unzipped-jdk-sources/11021")
nil
user=> (io/resource "java/lang/Thread.java")
but this works:
user=> (io/resource "java.base/java/lang/Thread.java")
#object[java.net.URL 0x42fcc7e6 "jar:file:/usr/lib/jvm/msopenjdk-current/lib/src.zip!/java.base/java/lang/Thread.java"]
So this code seem to be "too simple" to work in all cases:
(defn class->source [class-object]
{:pre [(class? class-object)]}
(-> class-object pr-str munge (string/replace "." "/") (str ".java") (io/resource) slurp))
As it does not take "modularisation" of tke JDK (sources) into considerationMaybe I wrote that part of the readme too long ago I take it that you got it fixed? https://github.com/clojure-emacs/enrich-classpath/pull/61 The way we use this stuff is https://github.com/clojure-emacs/orchard which uses the module system as needed
A short demo integrating the https://scicloj.github.io/clay/ tool for datavis & literate programming with #cider: https://www.youtube.com/watch?v=fd4kjlws6Ts This follows yesterday's demo using #calva. This time, we are looking into an image-processing use case. BTW I use the https://github.com/corgi-emacs/corgi Emacs configuration by @plexus & friends, which is so lightweight and nice for Clojure. Anyway, the demo does not rely on this specific config.