clj-light-refactor
clj-light-refactor copied to clipboard
Update middleware dependency (I)
I've been trying to get this plugin working with Clojure 1.9. After lots of fiddling it seems I need to update both dependencies refactor-nrepl
to 2.4.0-SNAPSHOT
and cider/cider-nrepl
to 0.18.0-SNAPSHOT
. (Due to some hiccup their non-SNAPSHOT versions aren't mutually compatible recently, from what I found in github issues clojure-emacs/refactor-nrepl#221 )
However this in turn triggers more error on this side. I've made the following changes so far:
-
Auto-Complete doesn't work (which is catastrophic for me since this actually replace LT's built-in and the disable escape-hatch never worked for me). Peeping at nrepl traffic, and then doing some archaeology on
refactor-nrepl
shows that clojure-emacs/refactor-nrepl@af9a236 removed the client namespace. Also, this plugin currently send some bashed together string through the nrepl for the other side to evaluate, which called this. So I copied the code from therefactor-nrepl
repo and inlined it. -
After update, "Find Usage" gets broken. Repeat the process, took me some squinting of my eyes to find out that the return format has subtly changed. In the old version the map is presented instead as a list alternating between key and value which is corrected in new version, e.g.
(:line-beg 3 :line-end 4)
vs{:line-beg 3 :line-end 4}
. I traced out the code in this plugin that "fixed" this format, and changed it to detect whether it is a map or not (in order to preserve backward-compatibility, if there is such a thing).
Unfortunately, now that nrepl
has upgraded (and even changed groupId etc), this doesn't work anymore. Moreover, because the other plugins (refactor and cider) have both migrated to support this new nrepl, we probably should upgrade too.
The difference I've found so far:
-
clojure.tools.nrepl
is changed tonrepl
(forlein-light-nrepl
, see note below) - To use the basic connection functions, use
nrepl.core
I'm not sure about the request/response format - yet.
Note: The Lighttable core plugin lein-light-nrepl
is impacted too - it seems we can't really "dodge" this anymore.