Closed slipset closed 1 year ago
Many thanks for this! I hope we will find some time (or someone with some time) for this soon. Really good to have some starting points.
I've never used clj-refactor
.
That said, if it has a Rename a Var command (firstly in the current namespace, secondly in all namespaces that require the Var), then I find that feature highly desirable to bring that to Calva.
Anybody who's used the Rename a Symbol command in VSCode JavaScript project will be able to tell how much productivity can be gained from having it. I personally switched from Calva to Cursive mostly just to get this functionality that I'm used to having in JS.
Just thought I should voice this up, apologies that I cannot contribute towards this at this point.
I hear you. We'll get there eventually. Right now we're caught up in some ground work. But the silver lining there is that it will make stuff like renaming vars much easier and safer to do.
Sidenote: this looks to be related to #215, as both mention clj-refactor
I believe much of this can be added via clojure-lsp
Just a side-note: The examples
directory in the clj-refactor.el
repo contains gifs showing each of its features, which gives an excellent visial overview of what it can do: https://github.com/clojure-emacs/clj-refactor.el/tree/master/examples
Most of this is implemented now, right? Via clojure-lsp.
Most of this is implemented now, right? Via clojure-lsp.
Yes, except for 1 in the original post, but maybe that's also possible in Calva via clojure-lsp or something else now?
I created a new issue with the remaining item from this one. Easier to handle that way. Closing this one.
In theory it should be enough to add
clj-refactor
as a middleware and set up the appropriate menus/keybindings, but there seems to be a difference between theory and practice here, as a lot of the functionality is a mix between middleware and elisp.FWIW, the functionality I use the most from clj-refactor is: 1) cljr-add-project-dependency, this is huge when greenfielding https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L2261 2) cljr-add-missing-libspec https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L2907 which is bound to
/
, so when you typefoo/
clj-refactor will search for previous aliasesfoo
and insert the appropriate:require
3) cljr-clean-ns https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L2742A lot of the other things I either don't know is there or I use pared it to fix it.
Also, some of the functionality that was previously in
clj-refactor.el
has been moved toclojure-mode.el
. An example would beclojure-thread-last-all
, https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el#L2306