This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-07
Channels
- # aleph (4)
- # announcements (9)
- # babashka (44)
- # beginners (6)
- # cider (8)
- # clj-kondo (5)
- # clojars (10)
- # clojure (10)
- # clojure-berlin (1)
- # clojure-dev (9)
- # clojure-europe (20)
- # clojure-gamedev (1)
- # clojure-miami (2)
- # clojure-nl (1)
- # clojure-norway (21)
- # clojure-uk (5)
- # clojurescript (12)
- # conjure (1)
- # cursive (19)
- # data-science (2)
- # datahike (10)
- # etaoin (5)
- # events (3)
- # fulcro (14)
- # gratitude (2)
- # honeysql (8)
- # humbleui (1)
- # hyperfiddle (60)
- # introduce-yourself (7)
- # jobs-discuss (27)
- # juxt (2)
- # kaocha (7)
- # lsp (23)
- # malli (9)
- # missionary (2)
- # off-topic (48)
- # pathom (24)
- # releases (1)
- # shadow-cljs (256)
- # sql (46)
- # xtdb (19)
How do i setup javadocs using intelliji and cursive?
maybe i just dont know how to view them. So in the code below how would i get java docs for Base64/getDecoder:
(ns point-codec
(:require
[ :as io]
[clojure.string :as str])
(:import
( DataInputStream)
(java.util Base64 UUID)
(java.util.zip GZIPInputStream)))
(defn unzip
[encoded-points]
(->> encoded-points
(.decode (Base64/getDecoder))
io/input-stream
GZIPInputStream.
DataInputStream.))
If you put the caret on e.g. Base64 and use View | Quick Documentation do you see it?
On a Mac it’s also bound to ^J
, I can’t remember the key code for other platforms. The doc will show them to you for your platform: https://cursive-ide.com/userguide/documentation.html
this is what i get:
in my other pure java project, i had to tell gradle to download the java docs. And in emacs with cider i had to enable something in the cider configuration, so i assume there is the same there here.
like, maybe the issue is that i'm using deps and not lein? (lein being more batteries included)
If you go to File | Project Structure… and then select Project on the left, you should see an SDK on the right.
Then, if you select SDKs on the left, and select the SDK you’re using on the right, what does that look like? If you click on Sourcepath, is there anything there?
i added the documentation path the editor recommended (first picture) and then i get some docs (second picture)
reading what you said now...
nothing in my sourcepath:
Ok, so I think that’s the problem, that your JDK doesn’t have sources downloaded. Probably the easiest fix is just to get IntelliJ to download another JDK, which will set it all up correctly. If you click +
, then download JDK… then follow the process, then select the new JDK for your project by selecting Project on the left again, then I think it should work for you.
Or you might have other JDKs lying around which IntelliJ has autodetected, they’ll be in the list when you click +
. You could check them and see if they work better. But if you don’t mind the download getting a new one is probably the most likely to just let you get on with your day.
thanks. Yep, i got the docs adding the documentation path. Ok, now i dont have to guess on how to get the docs for stuff, which was quickly becoming much harder then it was in pure clojure land.
That will work for platform classes, if you want the same for library classes it’s a little more involved. Deps doesn’t have a good way of downloading sources by default, but Cursive does have some support for this: https://cursive-ide.com/userguide/deps.html#downloading-and-attaching-source-artefacts