Skip to content

Commit fd58583

Browse files
committed
clean-ns: send both the absolute and relative path to the server
This makes use of a change to refactor-nrepl [1], but should be safe when using older versions of refactor-nrepl, as in that case it simply uses the absolute path, which is generally preferred over the relative one. When used with the change to refactor-nrepl it will try first the absolute, then the relative path, and use the first that can be found. [1]: clojure-emacs/refactor-nrepl#251
1 parent cd6b6fb commit fd58583

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- clean-ns: fix cases where this would generate a FileNotFoundException, by trying both the absolute and the relative path to the file to be cleaned.
6+
57
## 2.4.0 (2018-08-26)
68

79
- Compatible with CIDER 0.17 and 0.18.

clj-refactor.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2732,10 +2732,12 @@ removed."
27322732
(unless (and *cljr--noninteractive*
27332733
(not (buffer-modified-p)))
27342734
(save-buffer))
2735-
(let ((path (or path (cljr--project-relative-path (buffer-file-name)))))
2735+
(let ((path (or path (buffer-file-name)))
2736+
(relative-path (cljr--project-relative-path path)))
27362737
(when-let (new-ns (cljr--call-middleware-sync
27372738
(cljr--create-msg "clean-ns"
27382739
"path" path
2740+
"relative-path" relative-path
27392741
"libspec-whitelist" cljr-libspec-whitelist
27402742
"prune-ns-form" (if no-prune? "false"
27412743
"true"))

0 commit comments

Comments
 (0)