This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-11
Channels
- # announcements (1)
- # architecture (23)
- # beginners (189)
- # boot (1)
- # calva (62)
- # clj-kondo (23)
- # cljs-dev (9)
- # clojure (336)
- # clojure-dev (11)
- # clojure-europe (2)
- # clojure-italy (17)
- # clojure-nl (25)
- # clojure-uk (53)
- # clojurescript (12)
- # core-async (29)
- # data-science (1)
- # emacs (6)
- # fulcro (23)
- # garden (3)
- # graphql (2)
- # jobs (1)
- # joker (7)
- # off-topic (17)
- # om (2)
- # qlkit (1)
- # reagent (15)
- # reitit (18)
- # rewrite-clj (7)
- # shadow-cljs (176)
- # sql (1)
- # test-check (4)
- # vim (32)
- # xtdb (30)
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.
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.
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.
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
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.
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.
I think I have fixed your unrelated issue, @brandon.ringe. 😃 Please give latest Calva a spin.
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?Thanks! Ahh! Calva: Send current form (or selection) to the REPL window...
. This is the key to the castle!
@pez setting nrepl.middleware.pprint/stream?
to true
seemed to fix to go-loop logging issue!
@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 see those handlers piling up, never cleaned away. We need to figure out what that means and how to deal with it.
In my sleep. They wake me up. Haha. It is just the way I speak. What I mean is that I worry about it. 😎
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.