Not sure if this is #beginners or #emacs… I’m an emacs beginner!
Anyway, my problem is that I want a rename refactor. I installed clj-refactor
through M-x package-install and followed the README instructions to set it up in my emacs.d, but when I invoke it, it processes my project, asks me for the new variable name, and then fills the minibuffer with some kind of output and switches focus to my original buffer. I’d provide this output but I don’t know how to get it.
you can check the *Messages*
buffer. It should have the message in there
K. This is what I’ve got:
cljr--get-valid-filename: Wrong type argument: hash-table-p,
(#s(hash-table size 7 test equal rehash-size 1.5 rehash-threshold 0.8125
data (:line-beg 101
:line-end 101
:col-beg 4
:col-end 17
:name "scaffold-node"
:file "/Users/bphillips/src/clojure/gascan/src/gascan/repl.clj"
:match "[scaffold-node]"))
#s(hash-table size 7 test equal rehash-size 1.5 rehash-threshold 0.8125
data (:line-beg 129
:line-end 129
:col-beg 30
:col-end 43
:name "scaffold-node"
:file "/Users/bphillips/src/clojure/gascan/src/gascan/repl.clj"
:match "(loop [loc (z/vector-zip scaffold-node)]")))
check that your versions of cider and clj-refactor are up to date. i think they can get out of sync and break. hopefully the latest versions work together
Does rename refactor require the REPL to be running, I assume it does. I beieve you also need to have all the code in the project working (compiles without error)
I stopped using clj-refactor and use helm-swoop
to lists all instances of a symbol (function name) and C-c C-e
to open the results of the search across the project in a buffer. Then I just use iedit or multiple cursors to make changes to that buffer and C-c C-c
to commit the changes back to all the project files. I can do this for any text, so find it more useful than the clj-refactor rename.
And it does that by symbol reference? Not by string match?
All code is compiled and working
And the REPL is running, yes
I tried deleting cider and clj-refactor and installing the latest stable versions, but that doesn’t seem to do any good.
I assume it's string matching as it has so many tools available in Emacs to support that, none of which require the REPL or code to be analyzed. It works and very fast too. I hope you get clj-refactor working, but for me it became redundant in Emacs (Spacemacs) and I haven't used it for over a year or two now.