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 @@ -2702,7 +2702,7 @@ lists up."
2702
2702
(defun clojure--rename-ns-alias-internal (current-alias new-alias )
2703
2703
" Rename a namespace alias CURRENT-ALIAS to NEW-ALIAS."
2704
2704
(clojure--find-ns-in-direction 'backward )
2705
- (let ((rgx (concat " :as +" (regexp-quote current-alias)))
2705
+ (let ((rgx (concat " :as +" (regexp-quote current-alias) " \\ _> " ))
2706
2706
(bound (save-excursion (forward-list 1 ) (point ))))
2707
2707
(when (search-forward-regexp rgx bound t )
2708
2708
(replace-match (concat " :as " new-alias))
@@ -2767,7 +2767,7 @@ With a numeric prefix argument the let is introduced N lists up."
2767
2767
(let* ((current-alias (completing-read " Current alias: "
2768
2768
(clojure-collect-ns-aliases
2769
2769
(save-excursion (thing-at-point 'list )))))
2770
- (rgx (concat " :as +" current-alias))
2770
+ (rgx (concat " :as +" ( regexp-quote current-alias) " \\ _> " ))
2771
2771
(bound (save-excursion (forward-list 1 ) (point ))))
2772
2772
(if (save-excursion (search-forward-regexp rgx bound t ))
2773
2773
(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