announcements

Jarrod Taylor (Clojure team) 2025-11-18T17:30:48.169459Z

https://github.com/clojure/java.doc A Clojure library for accessing Javadocs in your REPL gets a v0.1.0 release. We have been kicking this around a bit and are interested in feedback about api changes that might be useful for toolmakers or common workflow patterns.

🆒 1
4
3
🎉 27
ericdallo 2025-11-18T17:32:46.064319Z

That's interesting! you may wanna share in #dev-tooling too

👍 1
ericdallo 2025-11-18T17:34:37.051569Z

That sounds like a good thing to use in clojure-lsp, when user hover or ask for docs for current symbol! I suppose it works only for jdk or any other libs somehow?

Jarrod Taylor (Clojure team) 2025-11-18T17:36:14.638719Z

It also supports retrieving information from jar sources as well.

ericdallo 2025-11-18T17:37:12.270099Z

oh cool, I don't see a example of that in docs, but sounds interesting

Jarrod Taylor (Clojure team) 2025-11-18T17:38:01.975469Z

Probably worth calling out in the readme. I’ll update

3
Alex Miller (Clojure team) 2025-11-18T17:40:20.944759Z

if you are a tool creator and interested in this functionality, we are interested in hearing your feedback about how to make the lower levels of it useful to you

👍 4
ericdallo 2025-11-18T17:42:22.444179Z

One of the major issues tooling has is java interop, at least in clojure-lsp / clj-kondo, actually I'm fixing one right now with borkdude https://clojurians.slack.com/archives/CPABC1H61/p1763467383675949 😂 So javadoc for sure may be a good addition

2025-11-18T17:43:56.446489Z

this is great. i know there's been some work to clean up doc in clojure core (clojure.repl?), so is this intended to be the alternative/better path to the built-in function?

phronmophobic 2025-11-18T17:44:07.839419Z

I'm interested in integrating this. One thing that I'll need to figure out is given some source code near the cursor, how do I prioritize this source of documentation vs :doc metadata. I'm currently using https://github.com/alexander-yakushev/compliment, which allows custom sources for docs and completions.

ericdallo 2025-11-18T17:45:11.879329Z

@smith.adriane I believe clojure/java.doc is focused on java docstrings, not clojure code

phronmophobic 2025-11-18T17:46:40.779619Z

right, but given some text near the cursor, you need to figure out which source to use. It's probably usually unambiguous, but there may be edge cases.

ericdallo 2025-11-18T17:47:41.547459Z

ah yeah, indeed, for clojure-lsp at least we already have this differentiation what is clojure and what is java from kondo analysis

phronmophobic 2025-11-18T17:47:49.418559Z

particularly, namespaces with :gen-class

🤔 1
Alex Miller (Clojure team) 2025-11-18T18:01:01.000299Z

something that is gen-classed will not have either kind of documentation

phronmophobic 2025-11-18T18:08:41.505949Z

Namespaces have doc strings.

Alex Miller (Clojure team) 2025-11-18T18:38:33.486619Z

how is that relevant?

2025-11-18T18:44:17.790869Z

will the docstring for clojure.java.javadoc be updated to recommend this library?

phronmophobic 2025-11-18T18:57:04.962319Z

The main way I intend to use clojure/java.doc is as source for "show relevant documentation for code near the text editor cursor". I am now noticing that jdoc-data and sigs aren't functions that accept symbols, but are macros. For an editor that wants to present a doc string for the code under the cursor, is the recommended way to resolve a method and get the doc string to call eval? eg. given some source code as a string like "^[char/1] String/valueOf" , is there a recommended way to get the markdown or list of signatures?

Jarrod Taylor (Clojure team) 2025-11-18T18:57:46.495519Z

Never rule out some grand unified doc strategy in the future but at the moment doc and clojure.java.javadoc will keep doing their thing. Some bits of clean up possibly coming to clojure.java.javadoc not withstanding. @nbtheduke

👍 1
2025-11-18T19:00:08.519769Z

it's fun to see y'all release libraries for stuff that at one point might have been builtins. makes me hopeful for the future (more core libraries, fewer built-in namespaces)

Jarrod Taylor (Clojure team) 2025-11-18T19:02:12.039199Z

jdoc-data and sigs are macros but they call through to public functions (`sigs-fn`, javadoc-data-fn) that accept strings in the api.clj ns. @smith.adriane

👍 1
phronmophobic 2025-11-18T19:11:11.600969Z

and classnames are resolved based on the value of *ns*?

2025-11-19T17:58:07.382269Z

Great tool ! Just report this as not working: (add-libs '{com.microsoft.onnxruntime/onnxruntime {:mvn-version "1.23.2"}}) (jdoc ai.onnxruntime.OrtSession/.run) No javadoc description available for this method. No javadoc description available for this method. No javadoc description available for this method. No javadoc description available for this method. No javadoc description available for this method. No javadoc description available for this method. No javadoc description available for this method. But I see javadoc here of the "run" method: https://onnxruntime.ai/docs/api/java/ai/onnxruntime/OrtSession.html

👀 1
Alex Miller (Clojure team) 2025-11-19T18:18:16.750469Z

@nbtheduke re your questions above in relation to core - there are a variety of ways this project may evolve and we have not yet had a conversation with Rich about that. we thought it useful now and worthy of getting feedback in its current form. Because this project depends on a pile of libraries (both tools.deps to find and download javadoc jars, and then parsing/formatting stuff to read and translate the javadoc html), it's not suitable for direct inclusion in core. However, it could be included via external tool invocation (as we do with add-libs) - that could be done as an addition/modification to clojure.java.javadoc ns (which has similar but different goals), or possibly by widening doc into a more open system and connecting it with that system. TBD on all of that.

👍 1
Alex Miller (Clojure team) 2025-11-19T18:23:05.740469Z

@smith.adriane you should use doc etc to get namespace doc strings. This tool is focused on javadoc for classes and methods. genclass'ed classes will be classes without javadoc and thus this tool will not be relevant. if the genclass'ed class implements interfaces, those are likely the more relevant place to look for documentation (same with reify / defrecord + deftype classes).

👍 1
2025-11-19T18:33:28.535959Z

Yeah I don't want or need this in clojure core, more wondering if (like clojure.xml -> clojure.data.xml) this is more of a "library supersedes outdated built-in" scenario and if it would be helpful to make such a note in the docstrings of the core namespaces

Jarrod Taylor (Clojure team) 2025-11-19T18:34:56.948309Z

@carsten.behring Thanks for the report. I believe there is an enhancement needed for arg parsing to accommodate this particular situation. Stay tuned.

Alex Miller (Clojure team) 2025-11-19T19:05:41.342159Z

clojure.java.javadoc model: find a public HTML javadoc URL (for small set of hardcoded URLs) some HTML javadoc, then view it in external HTML viewer clojure.java.doc model: download the HTML javadoc from a Maven repo (precise info known via basis), then translate it and view it in REPL these obviously overlap in class->html API and suggest it might be possible to bring these into alignment. we have tickets ready to update clojure.java.javadoc for the expected JVM bump in Clojure 1.13 and deprecating some of the existing long-broken ideas like googling for javadoc.

👍 1
Alex Miller (Clojure team) 2025-11-19T19:07:20.514709Z

if we can get to "don't make me add-lib and require to use it" either via jdoc or even existing doc, that would be pretty sweet imo

👍 1
ericdallo 2025-11-19T19:09:19.558849Z

TBH I believe this should be lying in tools like LSP, so clojure-lsp can get symbol and use clojure.java.javadoc under the hood and present, like we do for https://clojure-lsp.io/features/#documentation-and-clojuredocs-integration

➕ 2
Alex Miller (Clojure team) 2025-11-19T19:12:02.114259Z

possibly, I'm very interested in seeing what IDE level tools do with it (since they can hide the add-lib / require parts). I also don't know if the original html is actually better for those kinds of tools if they have html viewers - in that case the class->html part of the API is the more relevant bit

👍 1
Alex Miller (Clojure team) 2025-11-19T19:12:41.645409Z

or maybe it's all irrelevant if the IDE already has some class->html viewer feature, dunno

ericdallo 2025-11-19T19:15:53.074499Z

exactly, agree, and IDEs have the markdown support for those things, so the most important part is the string content, the rest is UI

Alex Miller (Clojure team) 2025-11-19T19:18:37.487669Z

sigs is probably independently useful (and actually doesn't really depend on anything javadoc related - we could really add that independently)

👍 2
Jarrod Taylor (Clojure team) 2025-11-20T20:13:19.099419Z

New version v0.1.2 released that fixes the issue reported by @carsten.behring

🎉 1