Probably it's not worth trying cljs compat since refactor-nrepl has limited cljs analysis IIRC. Not sure
replacement should be smart, avoiding false positives: e.g. if foo is to be renamed, one should avoid ocurrences of foo within string literals, comments, at the left hand of let bindings, etc.
So, replacement is best achieved with rewrite-clj, although analysis should be done with a richer tool
(Probably prior attempts exist)
Implement a refactoring function that moves var (or keyword)
x
from nsa
to nsb
, updating all consuming code within the current project.Consumers' require aliases should also be renamed, e.g.:
i.e. it would be counter-intuitive to emit
[net.vemv.bar :as foo]
Considerations
Should be IDE-agnostic.
See https://github.com/clojure-emacs/refactor-nrepl/tree/9e2a0cc2ff491906bcc4d36f1654caa2043f4903#find-symbol
Probably it's not worth trying cljs compat since refactor-nrepl has limited cljs analysis IIRC. Not sure
replacement should be smart, avoiding false positives: e.g. if
foo
is to be renamed, one should avoid ocurrences offoo
within string literals, comments, at the left hand oflet
bindings, etc.rewrite-clj
, although analysis should be done with a richer tool