cursive

2026-04-04T06:25:01.336349Z

Does cursive do some special resolution of doc strings for def? I’m trying to make a macro so that the on hover docs for constant defs show the actual value in the doc string automatically

(defmacro def-doc [sym v]
  `(def ~(with-meta sym {:doc (str "\n" (pr-str v)) :const true}) ~v))
However when I define this, with a resolve as def so it doesn’t show me undefined symbols, I just get a blank doc resolution So far I’m manually getting the effect

2026-04-06T06:26:58.299609Z

Ah, so analysing the code itself? Thanks @cfleming

cfleming 2026-04-04T20:04:50.577429Z

Unfortunately this won't work with Cursive, unless you're getting the doc in the REPL editor (which hits the live REPL). Cursive generally relies on the source code to provide the doc, and in this case obviously it's not there.