cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
niveauverleih 2020-12-22T16:19:09.379800Z

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

robert-stuttaford 2020-12-23T11:35:18.391800Z

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?

niveauverleih 2020-12-24T08:56:17.422100Z

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

Gleb Posobin 2020-12-22T16:23:00.381400Z

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.

dpsutton 2020-12-22T16:25:08.381600Z

> 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.

dpsutton 2020-12-22T16:25:18.381900Z

you're entering a prompt for the minibuffer

Gleb Posobin 2020-12-22T16:49:09.382300Z

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

dpsutton 2020-12-22T16:51:00.382900Z

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 Posobin 2020-12-22T16:51:19.383400Z

Is there another function that would do that?

dpsutton 2020-12-22T16:52:40.384Z

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

dpsutton 2020-12-22T16:53:05.384400Z

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

dpsutton 2020-12-22T16:53:56.385100Z

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 Posobin 2020-12-22T16:55:29.385800Z

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

dpsutton 2020-12-22T17:00:26.387400Z

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

dpsutton 2020-12-22T17:00:46.387800Z

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