Fork me on GitHub
#cider
<
2019-12-08
>
rjray01:12:44

Great, I think that fixed it!

Luiz Mineo18:12:21

Hi, can I use clj-refactor with shadow-cljs projects? I'm trying to enable it in a project created with the default re-frame template, but the repl complains that refactor-nrepl is missing WARNING: clj-refactor and refactor-nrepl are out of sync. Their versions are 2.5.0-SNAPSHOT (package: 20190618.716) and n/a, respectively. Already tried to add it as a dependency, on both project.clj and shadow-cljs.edn

aisamu22:12:57

Yes, you can! It looks like you're not loading the refactor-nrepl dependency (i.e. refactor-nrepl {:mvn/version "2.5.0-SNAPSHOT"})

Luiz Mineo00:12:26

Hi @alsamu, I already added refactor-nrepl as a dependency in project.clj and shadow-cljs.edn

Luiz Mineo00:12:35

[refactor-nrepl "2.5.0-SNAPSHOT"]

Luiz Mineo00:12:52

When the repl starts, it shows up in the startup command:

;; Connected to nREPL server - 
;; CIDER 0.24.0snapshot (package: 20191129.901), nREPL 0.6.0
;; Clojure 1.10.1, Java 11.0.4
;;     Docs: (doc function-name)
;;           (find-doc part-of-name)
;;   Source: (source function-name)
;;  Javadoc: (javadoc java-object-or-class)
;;     Exit: <C-c C-q>
;;  Results: Stored in vars *1, *2, *3, an exception in *e;
;;  Startup: /usr/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.2 -d refactor-nrepl:2.5.0-SNAPSHOT -d cider/cider-nrepl:0.23.0-SNAPSHOT server
;;
;; ClojureScript REPL type: shadow
;; ClojureScript REPL init form: (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :app) (shadow/nrepl-select :app))
;;
[:app] Configuring build.
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0-SNAPSHOT (package: 20190618.716) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.[:app] Compiling ...
[:app] Build completed. (519 files, 1 compiled, 0 warnings, 11,39s)

Luiz Mineo00:12:25

But when I try to invoke a clj-refactor command, like C-c C-m a m . It complains that refactor-nrepl is not available: user-error: The refactor-nrepl middleware isn't available! Did you remember to install it?

Luiz Mineo00:12:30

I know I'm probably doing something stupid here, just couldn't figure it out yet 🙂 Do you have any idea?

Luiz Mineo00:12:30

Solved! I just added the refactor-nrepl middleware in shadow-cljs.edn, and it's working properly now

:nrepl {:port 8777
         :middleware [refactor-nrepl.middleware/wrap-refactor]}
Thanks for the help

👍 2