@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
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
A humble reminder for Calva friends: Please consider subscribing to the CalvaTV Youtube channel. https://www.youtube.com/c/CalvaTV/
I see what you did there, @janne.sauvala!
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
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/
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.
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 ?
(sorry btw full disclosure I'm a clojure beginner)
So it times out?
yes it does ! I wanted to configure it out of existence 😛
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
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…
Maybe @bozhidar can shed some light on it for me.
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 ?
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.
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.
I see. So this timeout @fahd.elmazouni gets is happening in ClojureScript?
I wrote more about this in CIDER's docs - https://docs.cider.mx/cider/1.1/usage/code_evaluation.html#synchronous-vs-asynchronous-evaluation
It must be. It's certainly not happening in nREPL.
it's here ! https://github.com/bhauman/lein-figwheel/blob/master/sidecar/src/figwheel_sidecar/repl.clj
My google fu fails me, but at least now I know where to ask. Thanks for your super high service level, @bozhidar! ❤️
Good find, @fahd.elmazouni! Doesn’t look all that configurable, though…
thanks guys ! got the answer thanks to you !
:repl-eval-timeout is mentioned in this change log 😛 https://cljdoc.org/d/figwheel-sidecar/figwheel-sidecar/0.5.20/doc/changelog
Actually yes, I read it sloppily.