cursive icon indicating copy to clipboard operation
cursive copied to clipboard

Detect when sources are downloaded by lein and attach them.

Open cursive-ghost opened this issue 8 years ago • 2 comments

Lein generally has bad support for downloading source or JavaDoc artifacts for Java dependencies. But it is possible to do so using classifiers:

  :dependencies [[org.clojure/clojure "1.8.0"]
                 [junit "4.12"]]
  :profiles {:dev {:dependencies [[junit "4.12" :classifier "sources"]]}})

Cursive should detect this case and attach the sources to the library, and similarly for JavaDoc.

cursive-ghost avatar May 03 '17 00:05 cursive-ghost

It's possible to download sources also manually by running the commands:

lein pom
mvn dependency:sources

When Cursive refreshes the Leiningen projects, it would be useful if Cursive would detect automatically that the sources (or javadocs) already exist in the local Maven repository, and attach them to the library. Currently it's necessary to use IDEA's Download Sources button when navigating to a class, even though the sources already exist on disk.

luontola avatar Jan 27 '20 10:01 luontola

This would be a great feature. Doc support is the main thing that drew me to Cursive and IDEA, over Calva and VSC.

At the moment I'm just attaching the docs and sources manually through Settings->Project Structure->Libraries, and clicking the "Add" button for each dependency to include its docs and sources (if you're using classifiers, they're downloaded into the same folder so they're easy to find). This might seem obvious but it took me a while to figure out, so I thought I'd share.

Obscerno avatar May 28 '22 20:05 Obscerno