This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-07
Channels
- # babashka (17)
- # beginners (33)
- # calva (9)
- # cider (2)
- # clj-kondo (17)
- # cljs-dev (2)
- # cljsrn (2)
- # clojars (3)
- # clojure (60)
- # clojure-australia (2)
- # clojure-europe (8)
- # clojure-gamedev (5)
- # clojurescript (27)
- # cursive (2)
- # emacs (9)
- # fulcro (8)
- # gratitude (5)
- # lsp (41)
- # malli (3)
- # meander (18)
- # pathom (5)
- # polylith (25)
- # re-frame (17)
- # reagent (1)
- # rewrite-clj (6)
- # shadow-cljs (11)
- # uncomplicate (5)
- # vim (6)
- # web-security (5)
Would anyone have an emacs minor mode that adds keybindings for clojure-lsp’s refactorings?
Any reason why not always rely/use code actions instead of manually calling the refactors?
if your refactor is not on that list it's because it wouldn't work, so code actions are more reliable
Ok, I guess I’m not understanding the difference between a code action and a refactoring.
from LSP eyes, there is only code actions, clojure-lsp exposes the refactorings but you don't need to call it manually
my suggestion is to use code actions as they will have all the refactorings and it has a better UX
Using lsp-mode’s keymap, it has a
for actions and r
for refactor. Know I know refactorings are under code actions, I can find them 🙂
Oh, I got your question from lsp-mode code, the refactors are: lsp-organize-imports (that is a code action under the hood) lsp-rename which is not a code action, it's a LSP feature called rename
IMO keybindings for the clojure-lsp commands (refactorings) were useful when clojure-lsp didn't has the code actions feature, now IMO you can always rely on code actions
because if clojure-lsp return that code action, it's known that it will work if you call it, but if you call the refactoring manually, you need to know if that will work
i had to turn off the ui that shows the code actions everywhere. it was too noisy and unfortunately it would cause lots of "jumps" in the code when it introduces a new line for the actions
BTW I have also disabled the lsp-ui codea ctions, the modeline icon is way better to me :)
I actually added that icon support for lsp-mode because I didn't like the noisy lsp-ui code actions as well :p