This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-03
Channels
- # announcements (4)
- # aws (19)
- # babashka (55)
- # beginners (40)
- # biff (4)
- # calva (9)
- # cherry (3)
- # cider (8)
- # clj-kondo (26)
- # clj-yaml (3)
- # clojure (92)
- # clojure-austin (14)
- # clojure-europe (21)
- # clojure-nl (1)
- # clojure-norway (5)
- # clojure-portugal (3)
- # clojure-uk (2)
- # clojurescript (48)
- # conjure (19)
- # datalevin (14)
- # docker (13)
- # emacs (3)
- # fulcro (21)
- # gratitude (14)
- # improve-getting-started (1)
- # introduce-yourself (2)
- # joker (4)
- # juxt (2)
- # lsp (12)
- # malli (5)
- # meander (17)
- # off-topic (13)
- # re-frame (7)
- # scittle (2)
- # test-check (2)
has there been any success binding the Clojure refactoring tools into Conjure? I mostly want thread-first-all, thread-last-all, introduce-let and add-to-let.
Is that stuff built into CIDER? I haven't tried to hook anything in, I kinda want to leave that sort of thing to LSP if it's designed for it in any way.
yeah, it's built in to https://docs.cider.mx/cider/additional_packages.html#clj-refactor cider-refactor
although I'm not sure how to map sending the form under the cursor to those functions.
So the conjure.extract module is designed to make it easy for any code to pull the current form from under the cursor. If this tooling just needs some code + meta data + nrepl op name then it should be faaaairly straight forward to hook up.
There's also functions to replace forms I think? Since we have <prefix>e!
which evals then replaces the form with the result.
hm, so I might bind it to (1) wrap the form with a clj-refactor call; (2) send the eval-replace command
Hmm doable, but does the nREPL feature want an nREPL OP or do you need to evaluate some code?
One is using nREPL as the API, calling ops. The other is using Clojure as the API and evaluating Clojure code to make the refactor happen.
ah I see the distinction. I'll have to play around with this.
Because Conjure sends nREPL ops which you can also call into. There's a lower level set of functions that send nREPL messages rather than Clojure code (which is an eval op).
I can look into this some day too, but if you want it soon, you might have to look into it yourself first 😅 if you contributed this feature or released your own plugin that piggiebacks on Conjure as a mod I'm sure many would be happy.
I'd quite like to see more 3rd party mods for Conjure that can maaaaybe one day be merged in but also let the person with the desire / vision drive the feature forward and get the credit.
there's an existing plugin for Vim+Fireplace for doing these refactorings, I'll see if I can replace the Fireplace hooks with Conjure ones and get it working. thanks for the pointers; I'm sure I'll be back if I get stuck 😄
also thanks for Conjure! it works great for me even on a pretty big codebase (Metabase)
ahaha I just realized that the main author of the Fireplace plugin is a colleague at Metabase. I'll start there.