Fork me on GitHub
#cursive
<
2020-10-23
>
Joni09:10:46

Is there any way in cursive/idea to find all the unused function definitions in the project?

Lennart Buit09:10:03

Would Analyze > Inspect code help you?

Joni09:10:47

It only seems to find unused local symbols, which don't seem to contain unused functions.

AJ Jaro12:10:55

In the most recent version of Cursive, cmd-clicking a re-frame namespaced keyword does not show usages anymore. A user needs to right-click and Find Usages in order to show where that keyword is used. :sad-panda:

3
cfleming21:10:14

Do you mean the most recent EAP? Is this problem new in that version?

AJ Jaro01:10:03

This is happening here: 1.9.4-2020.2 @U0567Q30W

cfleming01:10:53

Thanks, I’ll take a look.

AJ Jaro01:10:22

Let me know if there’s anything I can do to help with this

cfleming03:10:34

It looks like this has been broken again in 2020.2 due to platform changes.

AJ Jaro10:10:29

Thanks for checking it out @U0567Q30W. I think there might be a similar problem with finding CLJC usages that are in CLJS namespaces but I haven't nailed the scenario down yet. I'll let you know when I figure it out in more detail

cfleming22:10:02

That’s possible, yeah - unfortunately the CLJC support needs a total re-vamp, the current impl is not very robust and violates some IntelliJ invariants.

Michael W19:10:36

Why does IDEA tell me it cannot resolve clojure.data.csv when the code works?

(ns com.repsrv.lib.csv
  (:require
    #?(:clj
       [ :as io])
    [clojure.data.csv :as csv]))

#?(:clj
   (defn take-csv
     "input path to file, output csv as coll of coll"
     [filename]
     (with-open [file (io/reader filename)]
       (-> (slurp file)
           (csv/read-csv)))))
IDEA says csv/read-csv can't be resolved. Am I missing something?

3
Michael W19:10:43

This was a problem with clojure deps, I had to update src paths and refresh on clojure deps tab for it to resolve correctly again.