calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
mauricio.szabo 2021-05-18T02:10:02.000100Z

@p-himik I tried exactly that on Chlorine and Clover with nrepl. Some stuff work, mostly don't. Fennel have another problem, that the nrepl implementation do not return "evaluation results", just return things as if they are printed on the console

mauricio.szabo 2021-05-18T02:11:12.000300Z

So in my case, I wasn't able to detect that the REPL was connected. I suppose Calva will connect, but not render the inline results of code

pez 2021-05-18T06:53:30.001800Z

A humble reminder for Calva friends: Please consider subscribing to the CalvaTV Youtube channel. https://www.youtube.com/c/CalvaTV/

7
❤️ 3
📺 5
pez 2021-05-18T11:13:28.003200Z

I see what you did there, @janne.sauvala!

😁 1
fel-mazo 2021-05-18T14:52:45.005900Z

Hello everyone ! I'm kind of stuck and my googling skills seem to be lacking... Is there a way to configure evaluation timeout in calva ? I'm trying to evaluate a form in a cljs repl

pez 2021-05-18T14:55:01.007400Z

There is no such config. Maybe you can wrap the evaluations in something that times out? And then use custom repl commands to wrap it. https://calva.io/custom-commands/

pez 2021-05-18T14:56:14.008900Z

Tell us a bit more about what it is you want to do. Maybe we can figure something out together, or maybe we will realize that we need an issue to track a feature request.

fel-mazo 2021-05-18T14:56:53.009Z

that's the thing I kind of don't want it to time out, you think I can manage to launch my evaluation in the background and have it run something once it's done to print the result ?

fel-mazo 2021-05-18T14:57:07.009200Z

(sorry btw full disclosure I'm a clojure beginner)

pez 2021-05-18T14:57:49.009400Z

So it times out?

fel-mazo 2021-05-18T14:59:23.009600Z

yes it does ! I wanted to configure it out of existence 😛

fel-mazo 2021-05-18T15:02:54.009800Z

https://github.com/clojure-emacs/cider/issues/2616 I found this, but it's cider specific, and I can't find much in nrepl docs

pez 2021-05-18T15:04:31.010100Z

I also found that one 😃 Seems it is possible in CIDER so maybe it is something we should support in Calva. Also there is talk there about async and sync calls, which I don’t quite follow…

pez 2021-05-18T15:09:00.010300Z

Maybe @bozhidar can shed some light on it for me.

fel-mazo 2021-05-18T15:10:40.010500Z

https://github.com/BetterThanTomorrow/calva/blob/a1afb5799bc8f1e4063badb8964f462b1da7dfcc/src/nrepl/index.ts#L289 this is the function that gets called to evaluate any code "selection" ? and I couldn't find any mention of "Eval timed out!" so I guess it must be coming from nrepl ?

bozhidar 2021-05-18T15:10:42.010800Z

There's no sync requests in nREPL, but Emacs doesn't handle async APIs well and I have implemented a simulation of sync requests - basically a function that waits for a response.

bozhidar 2021-05-18T15:11:20.011Z

That's dangerous, though, as it can lock-up the client that's why there's also some timeout associated with it. At any rate - that's just Emacs stuff that you can disregard completely.

pez 2021-05-18T15:12:08.011200Z

I see. So this timeout @fahd.elmazouni gets is happening in ClojureScript?

bozhidar 2021-05-18T15:12:15.011400Z

I wrote more about this in CIDER's docs - https://docs.cider.mx/cider/1.1/usage/code_evaluation.html#synchronous-vs-asynchronous-evaluation

bozhidar 2021-05-18T15:12:52.011600Z

It must be. It's certainly not happening in nREPL.

pez 2021-05-18T15:14:07.012100Z

My google fu fails me, but at least now I know where to ask. Thanks for your super high service level, @bozhidar! ❤️

1
pez 2021-05-18T15:15:26.012300Z

Good find, @fahd.elmazouni! Doesn’t look all that configurable, though…

fel-mazo 2021-05-18T15:15:30.012500Z

thanks guys ! got the answer thanks to you !

fel-mazo 2021-05-18T15:15:52.012700Z

:repl-eval-timeout is mentioned in this change log 😛 https://cljdoc.org/d/figwheel-sidecar/figwheel-sidecar/0.5.20/doc/changelog

pez 2021-05-18T15:16:08.013Z

Actually yes, I read it sloppily.