This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-17
Channels
- # announcements (17)
- # aws (2)
- # babashka (21)
- # beginners (67)
- # calva (19)
- # cider (29)
- # clara (3)
- # clj-kondo (6)
- # cljsrn (10)
- # clojure (140)
- # clojure-europe (164)
- # clojure-nl (3)
- # clojure-uk (8)
- # clojurescript (62)
- # conjure (7)
- # core-async (24)
- # cursive (21)
- # datomic (5)
- # docker (40)
- # emacs (14)
- # fulcro (25)
- # gratitude (1)
- # honeysql (6)
- # introduce-yourself (1)
- # jobs (1)
- # jobs-discuss (32)
- # juxt (7)
- # lsp (13)
- # minecraft (2)
- # off-topic (49)
- # pathom (24)
- # practicalli (8)
- # re-frame (18)
- # react (23)
- # remote-jobs (6)
- # reveal (2)
- # shadow-cljs (75)
- # tools-deps (7)
Hey all, I'm trying to install refactor-nrepl
into a project using deps.edn
. I have it in the :extra-deps
section just below cider-nrepl
and I see it loading during startup, but...
'user-error: The refactor-nrepl middleware isn’t available! Did you remember to install it?'
hi! one thing is adding the dep, another is starting a nrepl server with the cider-nrepl middleware and refactor-nrepl middleware in it have you tried something like that? Or is your use case different?
btw I cut https://clojars.org/refactor-nrepl/versions/3.0.0-alpha1 just now. It bundles all these: https://github.com/clojure-emacs/refactor-nrepl/blob/1399da2029c2e875d450af4caa347302f55fa965/CHANGELOG.md#unreleased they're all much-needed performance and reliability improvements, no new features / breaking changes. I'd much recommend using this one.
Thanks for the help! First question: since I'm using deps.edn and mostly maven artifacts, how long does it take to propagate?
I have CIDER working just fine, with the cider-nrepl middleware working very well.
But I have not done anything in code to start the refactor-nrepl
My mistake, I changed the wrong version number 😉
> I have CIDER working just fine, with the cider-nrepl middleware working very well. how do you start cider / cider-nrepl?
I run the app from the command line, then in emacs cider-connect-clj
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.1 (package: 20210628.1154) and n/a, respectively.
That's the message I get in the repl after connecting
in case it helps, the typical pattern is
(let [handler (refactor-nrepl.middleware/wrap-refactor cider.nrepl/cider-nrepl-handler)]
(nrepl.server/start-server :port port :handler handler))
the WARNING can be ignored, it's normal that they're out of sync (you are precisely using a custom version)
So starting the app with clojure -M:dev
gives an error:
`Syntax error (ClassNotFoundException) compiling at (my-project-name/dev.clj:36:17). refactor-nrepl.middleware`
However, if I comment out the offending code, start the app, then C-c C-c the file in cider, it compiles ok.
I'll have to dig into it a bit later, and let you know what I find.
$ clj
Downloading: refactor-nrepl/refactor-nrepl/3.0.0-alpha1/refactor-nrepl-3.0.0-alpha1.pom from clojars
Downloading: refactor-nrepl/refactor-nrepl/3.0.0-alpha1/refactor-nrepl-3.0.0-alpha1.jar from clojars
Clojure 1.10.3
user=> (require 'refactor-nrepl.core)
nil
> ClassNotFoundException gonna state the obvious, you have to require these namespaces. my snippet was maybe a little too terse
That’s probably it. When experimenting on code, I often just use the full namespace at the place of reference until I decide I want to keep the code. I guess that causes problems here.
I’ll try and report back later.
done https://clojars.org/refactor-nrepl/versions/3.0.0-alpha10 (edited with a good release version)
after many attempts, alpha10 is finally a decent release. I also recommend setting:
(cljr-ignore-analyzer-errors t)
if using Emacs. Feel free to report away any found stacktraces (those are typically printed to *messages*
), can fix quite quicklyOk, I’ll give that a shot.
I'm up and running! I needed refactor-nrepl.middleware
in the require
section.
cool! happy to hear! I have some alphas to release this week, since some features remain with the same quirks they have over the years. It's partly easy - a matter of upgrading our awesome https://github.com/clj-commons/rewrite-clj dep :)