Calva: Thoughts on integrating with/adding stuff from clj-refactor

Created on 27 Feb 2019  路  5Comments  路  Source: BetterThanTomorrow/calva

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 type foo/ clj-refactor will search for previous aliases foo and insert the appropriate :require
3) cljr-clean-ns https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L2742

A 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 to clojure-mode.el. An example would be clojure-thread-last-all, https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el#L2306

enhancement help wanted

Most helpful comment

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.

All 5 comments

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

Was this page helpful?
0 / 5 - 0 ratings