File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -2703,7 +2703,7 @@ lists up."
2703
2703
(defun clojure--rename-ns-alias-internal (current-alias new-alias )
2704
2704
" Rename a namespace alias CURRENT-ALIAS to NEW-ALIAS."
2705
2705
(clojure--find-ns-in-direction 'backward )
2706
- (let ((rgx (concat " :as +" (regexp-quote current-alias)))
2706
+ (let ((rgx (concat " :as +" (regexp-quote current-alias) " \\ _> " ))
2707
2707
(bound (save-excursion (forward-list 1 ) (point ))))
2708
2708
(when (search-forward-regexp rgx bound t )
2709
2709
(replace-match (concat " :as " new-alias))
@@ -2768,7 +2768,7 @@ With a numeric prefix argument the let is introduced N lists up."
2768
2768
(let* ((current-alias (completing-read " Current alias: "
2769
2769
(clojure-collect-ns-aliases
2770
2770
(save-excursion (thing-at-point 'list )))))
2771
- (rgx (concat " :as +" current-alias))
2771
+ (rgx (concat " :as +" ( regexp-quote current-alias) " \\ _> " ))
2772
2772
(bound (save-excursion (forward-list 1 ) (point ))))
2773
2773
(if (save-excursion (search-forward-regexp rgx bound t ))
2774
2774
(let ((new-alias (read-from-minibuffer " New alias: " )))
Original file line number Diff line number Diff line change 43
43
(+ (foo/a 1) (b 2))"
44
44
45
45
(clojure--rename-ns-alias-internal " lib" " foo" ))
46
+ (when-refactoring-it " should handle multiple aliases with common prefixes"
47
+
48
+ " (ns foo
49
+ (:require [clojure.string :as string]
50
+ [clojure.spec.alpha :as s]
51
+ [clojure.java.shell :as shell]))
52
+
53
+ (s/def ::abc string/blank?)
54
+ "
55
+ " (ns foo
56
+ (:require [clojure.string :as string]
57
+ [clojure.spec.alpha :as spec]
58
+ [clojure.java.shell :as shell]))
59
+
60
+ (spec/def ::abc string/blank?)
61
+ "
62
+ (clojure--rename-ns-alias-internal " s" " spec" ))
46
63
47
64
(when-refactoring-it " should handle ns declarations with missing as"
48
65
" (ns cljr.core
You can’t perform that action at this time.
0 commit comments