Fork me on GitHub
#cider
<
2017-07-04
>
featheredtoast00:07:41

hey yall, looking for some info about cider-refresh - it doesn't appear to honor an earlier call to set-refresh-dirs for me

featheredtoast00:07:51

is there a way to set up the refresh-dirs in cider's config perchance?

dominicm06:07:30

@featheredtoast cider-nrepl doesn't expose a set-refresh-dirs for it's version of tools.namespace (it uses a private copy)

dominicm07:07:45

In boot using cider-nrepl 0.15.0 snapshot, my jump to source seems to be going to the temporary directories in boot. Using the ops raw I get:

[{'status': ['done'], 'file': 'file:/home/dominic/.boot/cache/tmp/home/dominic/src/github.com/foo/bar
/a9/-m7ldk0/foo/bar/baz.cljs', 'name': baz', 'column': 1, 'id': 'fireplace-bian
ca2-1499151061-107', 'session': '6cf8e95c-33cc-4fc8-bd78-1aba3f6fd9cc', 'ns': 'foo.bar.baz', 'line'
: 15, 'arglists-str': '[uuid benefit at]'}]
which suggests this is a problem at the cider level. It seems to work OK in clojure files. Just not for cljs. Am I being daft, or should I raise an issue?

dominicm07:07:11

Looks like cljs & clj :file metadata is quite different which could cause the discrepancy.

dominicm09:07:16

(update :file
                  (fn [f]
                    (str
                      (let [path (java.nio.file.Paths/get f (into-array String []))]
                        (loop [n 0]
                          (if (= n (.getNameCount path))
                            :give-up
                            (let [x (.subpath path n (.getNameCount path))]
                              (if ( (str x))
                                x
                                (recur (inc n))))))))))
@richiardiandrea this fixes it for info-cljs. It's a bit of a hack (I think my loop-recur is non-idiomatic & should be replaced with a reduce over (range) or something). It could also validate that the absolutePath of the resource is the same as f to reduce false positives.

featheredtoast14:07:30

@dominicm I'm trying to work around https://github.com/clojure-emacs/cider-nrepl/issues/376 https://dev.clojure.org/jira/browse/TNS-45 https://github.com/stuartsierra/component/issues/45#issuecomment-245052313 - my component works in the repl after a call to set-refresh-dirs to exclude the user ns, but I cannot currently configure the same workaround in cider-refresh.

dominicm16:07:11

@featheredtoast if you're desperate you could try calling the same function on CIDER's private copy of tns