Fork me on GitHub

So, about those missing printouts. It is because currently the Calva nrepl client stops listening for messages once it gets a done from the nrepl server. So when that go-loop returns (which is immediately), I close the door and the stdout arriving after that are smashed to death against that door (though, they are softer than marshmallows, so you don't hear the sound unless you have super human ears). If I keep the door opened, the messages are printed as expected. But I am quite in the dark on how to handle this properly. Seems my housekeeping is not really prepared for this. If anyone of you guys is good with concurrency and listeners like this, I'd welcome some help a lot. Maybe then we can look at how to support nrepl streaming output as well.

👍 4

I'm not sure if I will have the time the dig into the code, but unfortunately I'll have to go back to the previous version of Calva until this works since my daily workflow relies a lot on these logs. I must admit, I have never used Emacs, and it looks like it would take me a while to get it set up and get used to it for Clojure. I have every intention to stick with the new Calva in the future 🙂. Maybe I can try to find the time to hack on the code.


You can do what I do, work with Calva in the debugger. Then just change that line I pointed out to return false instead and see how that works. Would be cool to leverage this bug to get you started with Calva dev. 😃


I am attempting this now, but not seeing that change make the print statements work =(. I may be doing something wrong. I have the latest of Calva in my own fork. I changed that line to return false in the eval function. I followed the how-to-contribute directions and started all the watch tasks, then hit F5. In the extension development host I opened a new repl. I ran the code and I'm actually seeing print statements but they are delayed.


I'm not sure if my change was picked up or not. The only thing I don't understand is step 5 -> Go back to the Calva code and connect to the REPL. Choose to connect to the :calva-lib cljs REPL.


Not sure how to do that or if it's necessary to test my change


That's only necessary if you work with the cljs code.

👌 4

To be fair, this go-loop sample code does not work in legacy calva either, but that's just using lein repl in cmd/powershell. However, for some reason my actual project logs seem to work.




It's funny you get the printouts on the same line.


What do you mean with delay? How much is it delayed?


Well, I think it should be that way since the code is using print and not println


Several seconds


like 20+ maybe


Strange. But it probably has to do with it being print and not println. Can you try?


Those user=> prompts are from me hitting Enter to try to see output. Then I just left it alone and was doing something in another window and saw it print a bunch at once


Sure one minute


We don't do streaming yet, so I'm guessing nrepl is buffering stuff.


Yeah seems that way


I know pretty much nothing about this stuff though, but happy to test


I don't know enough either. It's a journey of learning.

simple_smile 4

You could try if streaming makes a difference.


What do you mean?


In that link that Bozhidar gave me in that issue about pretty printing. There was info there about how to enable nrepl to stream the results.


It could make those print calls not wait 20+ seconds. But that is just a guess.


Sounds logical


Ahh so println actually prints the statements real time


Depending on your workflow, you could get away with opening a terminal in vscode and run lein repl :connect there, and then use that repl for the commands where you need the output properly handled.

👍 4

when returning false in eval


Yeah, that was what I thought it would.


print seems to print all buffer data every ~60 seconds


And maybe streaming would stop that.


I'm not by a computer, so can't help much right now.


No problem. If I get some time I will look into it


I think I have fixed your unrelated issue, @brandon.ringe. 😃 Please give latest Calva a spin.

🎉 4

It works 🎉


Closed issue


wow! new Calva is awsome! thanks 👍

calva 8

Congrats on the new version and thanks for all of your work on this! I'm trying to get my sea legs. Jack-in seems to work fine (yea!), and I get a CLJ REPL pane, but when I put this in my editor pane:

(dotimes [i 100]
  (println i))
and run the Clava: evaluate current form (or selection) command I get nothing in CLJ REPL, the numbers from 0 to 99 but with extra newlines in Output:Calva Says (followed by => nil on its own line), and => nil overlaid on the editor pane. I would very much like to get the numbers from 0 to 99 without extra newlines (that is, exactly and only what my code printed), followed by the indication of the return value, => nil) somewhere. I don't mind much if it's in the CLJ REPL or the output pane, but I'd like the program output to appear, unadulterated, somewhere. I would also like not to ever have anything overlaid on the editor pane. IMNSHO that should show only the text that is in the file being edited. Is there an alternative command I could be using to get the behavior I'm looking for?


There is a command for evaluating the current form in the repl window


As well as the top level form.


Welcome back, btw!


Thanks! Ahh! Calva: Send current form (or selection) to the REPL window.... This is the key to the castle!

🔑 4
🏰 4

You can also copy the last results to the clipboard: ctrl+alt+c ctrl+c.


Nice -- thanks.


@pez setting nrepl.middleware.pprint/stream? to true seemed to fix to go-loop logging issue!


Even returning true from the messageHandler fn


That's interesting. And cool.


@pez false alarm 😑 . Did not build the code so changes weren't running. Stream does not fix it, still have to return false for it to work.


I can work with it like this though, I wonder the effects of always returning false.


I see those handlers piling up, never cleaned away. We need to figure out what that means and how to deal with it.

👍 4

Just curious, how are you seeing them?


In my sleep. They wake me up. Haha. It is just the way I speak. What I mean is that I worry about it. 😎


Oh, haha. 😎

Jacob Haag18:06:02

Is it possible to peek definitions of re-frame events with the new Calva extension?


@jacobhaag17, no, not currently. There was someone starting some work on that, but I don’t think he finished it.