BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.67k stars 217 forks source link

Thoughts on integrating with/adding stuff from clj-refactor #137

Closed slipset closed 1 year ago

slipset commented 5 years ago

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

PEZ commented 5 years 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.

amitnovick commented 5 years ago

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.

PEZ commented 5 years ago

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.

adamfeldman commented 4 years ago

Sidenote: this looks to be related to #215, as both mention clj-refactor

bpringe commented 3 years ago

I believe much of this can be added via clojure-lsp

leifericf commented 2 years ago

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

PEZ commented 2 years ago

Most of this is implemented now, right? Via clojure-lsp.

bpringe commented 2 years ago

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?

PEZ commented 1 year ago

I created a new issue with the remaining item from this one. Easier to handle that way. Closing this one.