Hello, I had opened a github issue, and am looking for additional info for solving the problem I am having with Calva
I am trying to run a CLJS repl, and it works until I start using promises
Whenever I run the promises, I never see the resolved output of the promise in the jack-in window
I see that a promise was fired (the window says #object[Promise [object Promise]]
), but then never see any resolved output in the window
For additional clarification, I am not using shadow-cljs or anything like that, just the plain vanilla node-repl with the CLJS dependency needed to compile CLJS in my deps.edn
Here is a snippet of the code I am running:
(ns temp
(:require [axios]))
(def resp-prom
(.get axios "<https://example.com>"))
(.then resp-prom #(js/console.log %))
my understanding is that I should see the output from the js/console.log
after the promise resolves, but do not see any output
Is it possible I am using .then
wrong and that is causing an issue?
also I am using the standard jack-in sequence, and then choosing node-repl
when prompted for a repl
Any ideas on what the issue is here?
Is the promise isn't resolving successfully, it might be resolving unsuccessfully so maybe try .catch
too
Ohh, it might also be that since this is async, js/console.log is printing somewhere else
You could try https://github.com/djblue/portal#usage and see if you can tap> the value instead :thinking_face: #shameless-plug
Thank you, I will look into this, and will try using a catch block
If it is printing somewhere else, is there a way to redirect this to the running repl in the jack-in window?
This prints 42
in the output window when I try:
(.then (js/Promise.resolve 42)
#(js/console.log %))
@anonmail053: this also prints 42 :
(def prom (new js/Promise
(fn [resolve, reject]
(js/setTimeout
(fn [_]
(resolve 42))
5000))))
(.then prom #(js/console.log %))
Hi, I wonder if it's possible to customize the commentFormStyle with backgroundColor, such that it extends across the entire width of the screen?
I find this easier to tell at a glance than italics if you're in a comment form, but the jaggedness is quite distracting
I don’t think so. Well, at least not how it is implemented today. Some googling on vscode.TextEditorDecorationType
might dig up something we could use to make this possible,
iirc, this is how I ended up choosing italics.
(b/c I couldn’t style the background color of the lines.)
But you can go pretty wild with glow effects and such. 😃
heh, I tried googling a bit but nothing came up
some sort of gutter marking might also be nice
Gutter markings are at least possible. 😃
This seems to hint that adding background color beyond the content isn’t within reach: https://marketplace.visualstudio.com/items?itemName=matthewhazlehurst.line-highlighter
ah, that's too bad
I'm happy with the gutter solution, but somehow you can't just specify a color - I had to make a 1x1px image
I tried setting overviewRulerColor too, but for some reason that disappears when you scroll off screen
I have been wanting to have a marker for when a form is “dirty” compared to what the REPL has evaluated. Seems like the gutter would be a nice place to have such a marker.
Oooh. This is a great ideA!!! Would Iove this!
I don’t think we have an issue for it. Just sayn’ 😃 If you want to file such an issue, be my guest. Would be good if we looked at what prior art there is. I think CIDER has a similar feature. (iirc, it marks up-to-date forms instead of the dirty ones).
Hi. I always wondered... is there any support for project.clj
or deps.edn
in Calva? Features such as "schema" (or "sanity") "validation", code completion for dependencies or something similar? If not, would something like that even possible/achievable/usable?
There isn’t. I think it would be super nice. Entirely possible too.
@brdloush clj-kondo checks deps.edn
to some degree (and that’s built-in with Calva now, right?).
hmm, what would count as a form being "dirty"?
I guess when you (def x ...)
and then def y (something x))
and then go back and change x?
New Calva out. A change in the ergonomics of one feature, an upstream bug fix and a fix for a regression that had snuck in: https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.191 • https://github.com/BetterThanTomorrow/calva/issues/644 • Fix: https://github.com/BetterThanTomorrow/calva/issues/1131 • Bump `cider-nrepl` to https://github.com/clojure-emacs/cider-nrepl/blob/master/CHANGELOG.md#02511-2021-04-12
I think it just means specifically if a form either: a) hasn't yet been evaluated b) has been edited since it was last evaluated
It's built-in via clojure-lsp, yes.
Yeah, I'll often write a function, evaluate it, call it and see it doesn't work, change the function and forget to evaluate it. Then re-call it and confuse my simple brain for a minute.
This is correct