File tree 3 files changed +29
-10
lines changed
3 files changed +29
-10
lines changed Original file line number Diff line number Diff line change 43
43
(some (set symbols-in-file) (map str (vals rename))))
44
44
45
45
(defn- libspec-in-use?
46
- [{:keys [refer] :as libspec} symbols-in-file current-ns]
47
- (when (or (if (= refer :all )
48
- (some (partial libspec-in-use-with-refer-all? libspec current-ns)
49
- symbols-in-file)
50
- (some (partial libspec-in-use-without-refer-all? libspec)
51
- symbols-in-file))
52
- (libspec-in-use-with-rename? libspec symbols-in-file))
53
- libspec))
46
+ [{libspec-refer :refer
47
+ libspec-ns :ns
48
+ libspec-as :as
49
+ :as libspec} symbols-in-file current-ns]
50
+ (let [refer-all? (= libspec-refer :all )
51
+ libspec-as-str (str libspec-as)
52
+ symbols-in-file (cond-> symbols-in-file
53
+ (and (string? libspec-ns)
54
+ (not refer-all?)
55
+ libspec-as
56
+ (contains? (set symbols-in-file) libspec-as-str))
57
+ (conj (str (symbol libspec-ns libspec-as-str))))]
58
+ (when (or (if refer-all?
59
+ (some (partial libspec-in-use-with-refer-all? libspec current-ns)
60
+ symbols-in-file)
61
+ (some (partial libspec-in-use-without-refer-all? libspec)
62
+ symbols-in-file))
63
+ (libspec-in-use-with-rename? libspec symbols-in-file))
64
+ libspec)))
54
65
55
66
(defn- referred-symbol-in-use?
56
67
[symbol-ns used-syms sym]
Original file line number Diff line number Diff line change 10
10
[" react" :as react]
11
11
[" underscore$default" :as underscore]
12
12
[" react-UNUSED" :as react-unused]
13
- [" underscore-UNUSEd$default" :as underscore-unused])
13
+ [" underscore-UNUSED$default" :as underscore-unused]
14
+ [" @react-native-async-storage/async-storage" :as AsyncStorage])
14
15
(:require-macros [cljs.test :refer [testing]]
15
16
[cljs.analyzer.macros :as am]
16
17
cljs.analyzer.api)
29
30
[]
30
31
(react/foo underscore/bar))
31
32
33
+ ; ; https://github.com/clojure-emacs/clj-refactor.el/issues/529
34
+ (defn use-as
35
+ " Uses an `:as` name as an object in itself"
36
+ []
37
+ (.getItem AsyncStorage " foo" ))
38
+
32
39
(deftest tt
33
40
(testing " whatever"
34
41
(is (= 1 1 ))))
Original file line number Diff line number Diff line change 1
1
(ns cljsns
2
- (:require [" react" :as react]
2
+ (:require [" @react-native-async-storage/async-storage" :as AsyncStorage]
3
+ [" react" :as react]
3
4
[" underscore$default" :as underscore]
4
5
[cljs.pprint :as pprint]
5
6
[cljs.test :refer-macros [deftest is]]
You can’t perform that action at this time.
0 commit comments