File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -1227,9 +1227,14 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-stop-referring"
1227
1227
(paredit-backward)
1228
1228
(clojure-delete-and-extract-sexp)
1229
1229
(clojure-delete-and-extract-sexp)
1230
- (if (looking-back " \\ w+ " 3 )
1231
- (just-one-space 0 )
1232
- (join-line ))
1230
+ (cond
1231
+ ((looking-at-p " \\ s-*[\\ w:]+" )
1232
+ (just-one-space ))
1233
+
1234
+ ((looking-back " \\ w+ " 3 )
1235
+ (just-one-space 0 ))
1236
+
1237
+ (t (join-line )))
1233
1238
(cljr--add-ns-prefix (or alias ns) symbols))))))
1234
1239
1235
1240
(defun cljr--add-ns-prefix (ns symbols )
Original file line number Diff line number Diff line change @@ -89,3 +89,23 @@ Feature: Stop referring
89
89
(+ (lib/a 1) (lib/b 2))
90
90
(+ (A 1) (B 2))
91
91
"""
92
+
93
+ Scenario : With :as after the :refer
94
+ When I insert:
95
+ """
96
+ (ns cljr.core
97
+ (:require [my.lib :refer [a b] :as lib]))
98
+
99
+ (+ (a 1) (b 2))
100
+ (+ (A 1) (B 2))
101
+ """
102
+ And I place the cursor before "my.lib"
103
+ And I press "C-! sr"
104
+ Then I should see:
105
+ """
106
+ (ns cljr.core
107
+ (:require [my.lib :as lib]))
108
+
109
+ (+ (lib/a 1) (lib/b 2))
110
+ (+ (A 1) (B 2))
111
+ """
You can’t perform that action at this time.
0 commit comments