Fork me on GitHub
#cider
<
2020-12-22
>
niveauverleih16:12:09

Does clj-refactor work with jdk11? I get refactor-nrepl is unreachable.

niveauverleih06:12:44

Does anyone use clj-refactor?

robert-stuttaford11:12:18

I set https://github.com/robert-stuttaford/clj-cljs-app/ up on JDK11 and it works. Perhaps the answer you need is somewhere in how this is set up?

niveauverleih13:12:39

Thank you! That excludes JDK11 as a cause. I use spacemacs with the clojure layer (clojure :variables clojure-enable-clj-refactor t) This should work automagically.

niveauverleih08:12:17

Finally, I deleted refactor-nrepl in .m2 . Cider re-downloaded it and now it works.

Gleb Posobin16:12:00

How do I bind a clojure eval to a shortcut? There is cider-read-and-eval but if I call (cider-read-and-eval "(user/restart)"), the command appears in the minibuffer and I have to additionally press Enter to eval it.

dpsutton16:12:08

> Read a sexp from the minibuffer and output its result to the echo area. If VALUE is non-nil, it is inserted into the minibuffer as initial input.

dpsutton16:12:18

you're entering a prompt for the minibuffer

Gleb Posobin16:12:09

Yes, but how do I avoid having to press enter?

dpsutton16:12:00

you can't with that function. that's why i posted the docstring. that function is for reading from the minibuffer and a prompt. you will always end up in the minibuffer

Gleb Posobin16:12:19

Is there another function that would do that?

dpsutton16:12:40

if you read the source of that function you can see all the things its doing. but its ultimately calling (cider-interactive-eval form)

dpsutton16:12:05

there's some stuff relating to namespace but if you want just a simple thing that form there will do it

dpsutton16:12:56

its making a new buffer, putting an ns form of whatever the current namespace is in the buffer you're calling it from, and then your form and calling eval on the form

Gleb Posobin16:12:29

Ah, great, thank you! I tried looking at the source but it seemed like a lot of stuff going on there.

dpsutton17:12:26

read it again with that in mind. 1. get the current ns and make an ns form out of it "(ns %s") cider-current-namespace 2. get a buffer made just for this and erase it 3. make sure its in clojure-mode 4. if we have a ns form insert it 5. put our form in there 6. eval the form

dpsutton17:12:46

i'm not sure why the form is in the buffer and in the interactive eval form but whatever ¯\(ツ)