Fork me on GitHub
#cider
<
2023-01-07
>
Matthew Odendahl00:01:09

I'm having better luck with the Clojure LSP's equivalent, but it's not working right either, and I usually have to manually clean up the parts it misses.

vemv11:01:45

I could have a look at it, it's been a while since last time we went fixing stuff on refactor-nrepl

vemv11:01:56

tbh I'd just cut and paste the form from ns to ns for any token with a / (e.g. foo/bar) I'd use cljr-slash - you can delete the / there , type / again and it will offer sensible completions (or just autocomplete the single possible option if there's just one) And for symbols that need to be refer ed, I'd use the cljr-add-missing command over each such symbol. Both commands are very much polished. I know it's slightly manual, but if you've built some muscle memory around these two commands (which is much worthwhile), it should be all pretty quick :)

Matthew Odendahl22:01:28

For moving one form, sure. For splitting up a thousand-line namespace in a large application into five pieces, it gets really tedious. Took me days using an approach similar to what you suggest (using both the Clojure LSP and CIDER in Spacemacs, plus command-line kondo to catch anything I missed). Wouldn't have been that hard in e.g. Python with PyCharm.

👍 2
vemv17:01:03

There's also https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-rename-file-or-dir which unlike move-form did receive some love over the last year