Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crrf and crrd (rename file/directory) result in a Fireplace error #24

Open
daveyarwood opened this issue May 18, 2018 · 3 comments
Open

Comments

@daveyarwood
Copy link

I can't seem to get crrf or crrd to work at all. When I try, I get errors from Fireplace. One wrinkle is that I'm not exactly sure what I need to enter -- is it acceptable to just enter foo.clj, or do I need to specify the entire path to the new filename?

I tried both of those, resulting in the error messages below. The first two are from crrf, the latter two from crrd.

Error: Error during fireplace#message: Can't find src dir prefix for path foo.clj
"src/workflow/pitch.clj" 31L, 1104C written
Error: Error during fireplace#message: Can't find src dir prefix for path src/workflow/foo.clj
"src/workflow/pitch.clj" 31L, 1104C written
Error: Error during fireplace#message: Can't find src dir prefix for path foo/pitch.clj
"src/workflow/pitch.clj" 31L, 1104C written
Error: Error during fireplace#message: Can't find src dir prefix for path src/foo/pitch.clj
1 change; before #200  1 seconds ago
@SevereOverfl0w
Copy link
Member

I think this has to be the absolute path, but there's no reason nvim-refactor shouldn't be expanding this on your behalf.

@daveyarwood
Copy link
Author

I can confirm that crrf works when I use an absolute path. One weird thing I noticed, though, is that it did not respect my preference let g:clj_refactor_prefix_rewriting = 0 in my vimrc:

(ns workflow.pitch-test
  (:require [clojure.test :refer [deftest is testing]]
            [workflow
             [foo :as pitch]
             [test-helpers :refer [=ish round]]]))

When I do crcn immediately afterward, it does respect my preference:

(ns workflow.pitch-test
  (:require [clojure.test :refer [deftest is testing]]
            [workflow.foo :as pitch]
            [workflow.test-helpers :refer [=ish]]))

It looks like crrd has the same behavior of not honoring that preference.

@hukka
Copy link

hukka commented Jul 10, 2018

After getting a hint I need to have a repl running, I'm now getting
Error: Error during fireplace#message: Can't find src dir prefix for path /home/hukka/repos/reititin/src/reititin/foo.clj
with absolute paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants