clj-refactor.nvim icon indicating copy to clipboard operation
clj-refactor.nvim copied to clipboard

`crrs` (rename symbol) does not replace all instances of the symbol

Open daveyarwood opened this issue 7 years ago • 2 comments

I have a test file with a bunch of test cases like:

(testing "frequency -> the nearest MIDI note"
  (is (= (pitch/hz->midi 7.95) 0))
  (is (= (pitch/hz->midi 8.176) 0))
  (is (= (pitch/hz->midi 25.96) 20))
  (is (= (pitch/hz->midi 26) 20))
  (is (= (pitch/hz->midi 107.3) 45))
  (is (= (pitch/hz->midi 261) 60))
  (is (= (pitch/hz->midi 430) 69))
  (is (= (pitch/hz->midi 439) 69))
  (is (= (pitch/hz->midi 440) 69))
  (is (= (pitch/hz->midi 441) 69))
  (is (= (pitch/hz->midi 8372) 120)))

If I go into the example.pitch namespace (aliased in the test file above as pitch), move my cursor over the pitch/hz->midi function name in the defn form, and use crrs to rename it to foop, it renames the function in the example.pitch namespace, but only replaces the first instance of pitch/hz->midi in the test file with foop:

(testing "frequency -> the nearest MIDI note"
  (is (= (foop 7.95) 0))
  (is (= (pitch/hz->midi 8.176) 0))
  (is (= (pitch/hz->midi 25.96) 20))
  (is (= (pitch/hz->midi 26) 20))
  (is (= (pitch/hz->midi 107.3) 45))
  (is (= (pitch/hz->midi 261) 60))
  (is (= (pitch/hz->midi 430) 69))
  (is (= (pitch/hz->midi 439) 69))
  (is (= (pitch/hz->midi 440) 69))
  (is (= (pitch/hz->midi 441) 69))
  (is (= (pitch/hz->midi 8372) 120)))

Also note that it should have replaced it with pitch/foop.

daveyarwood avatar May 18 '18 14:05 daveyarwood

Not sure if it's related, but seems like renaming a function does not change spec/fdef calls for that function.

hukka avatar Jul 10 '18 07:07 hukka

This needs mirroring upstream at clojure-emacs/refactor-nrepl

On July 10, 2018 8:53:13 AM GMT+01:00, Tomi Hukkalainen [email protected] wrote:

Not sure if it's related, but seems like renaming a function does not change spec/fdef calls for that function.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/clojure-vim/clj-refactor.nvim/issues/25#issuecomment-403733654

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

SevereOverfl0w avatar Jul 10 '18 15:07 SevereOverfl0w