This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-12
Channels
- # announcements (2)
- # babashka (26)
- # beginners (48)
- # calva (32)
- # cider (23)
- # clj-kondo (61)
- # cljfx (3)
- # clojure (93)
- # clojure-australia (2)
- # clojure-europe (23)
- # clojure-losangeles (1)
- # clojure-nl (5)
- # clojure-uk (4)
- # clojurescript (46)
- # cloverage (9)
- # code-reviews (1)
- # copenhagen-clojurians (1)
- # cursive (39)
- # data-science (6)
- # datahike (8)
- # deps-new (8)
- # depstar (2)
- # etaoin (1)
- # fulcro (2)
- # funcool (2)
- # graalvm (5)
- # jackdaw (3)
- # java (17)
- # jobs-discuss (43)
- # kaocha (2)
- # leiningen (25)
- # malli (8)
- # minecraft (1)
- # missionary (8)
- # observability (6)
- # off-topic (37)
- # other-languages (12)
- # practicalli (1)
- # reagent (4)
- # releases (78)
- # remote-jobs (1)
- # sci (9)
- # shadow-cljs (13)
- # spacemacs (6)
- # sql (1)
- # tools-deps (24)
- # xtdb (3)
I'm working on my first node project with Calva and shadow-cljs and do not understand why some output doesn't show up in the repl. For example:
(let [tn (js/setTimeout #(println "hello") 1000)]
(println tn))
;; output
#object[Timeout 28348]
nil
"hello" is not printed. But the corresponding js code in a node repl gives:
> setTimeout(()=>console.log("hello"), 1000)
Timeout {
_idleTimeout: 1000,
_idlePrev: [TimersList],
_idleNext: [TimersList],
_idleStart: 69189,
_onTimeout: [Function (anonymous)],
_timerArgs: undefined,
_repeat: null,
_destroyed: false,
[Symbol(refed)]: true,
[Symbol(kHasPrimitive)]: false,
[Symbol(asyncId)]: 167,
[Symbol(triggerId)]: 5
}
> hello
Is this the expected behavior? Is there a way to see the async output in the Calva repl?With the first code snippet, do you see “hello” printed in the terminal that’s running the repl (not the output/repl window)?
Without Calva, the code works correctly, however:
❯ npx shadow-cljs node-repl
shadow-cljs - config: /Users/dan/projects/work/metabase/shadow-cljs.edn
shadow-cljs - connected to server
cljs.user=> shadow-cljs - #5 ready!
cljs.user=> (let [tn (js/setTimeout #(println "hello") 1000)]
(println tn))
#object[Timeout 52]
nil
cljs.user=> hello
So it seems that there is an issue with Calva's repl. Any thoughts, @U9A1RLFNV @U0ETXRFEW?Let’s see if @U0ETXRFEW might know more about this. It could be caused by nrepl or by Calva’s handling of nrepl messages.
I made a minimal repro and filed an issue: https://github.com/BetterThanTomorrow/calva/issues/1468
In answer to this, @U05224H0W wrote: > The output of a `(shadow.cljs.devtools.api/node-repl)` is captured just as the regular CLJS node REPL. This is because the whole node process is managed and stdout/stderr can easily be captured. The `:node-script` build however does not capture that output because the user is in control of the `node` process. > This is expected and working as intended. If you must have all the output of a node REPL use the managed `node-repl`. The problem is that I don’t know how to “use the managed node-repl” in or out of Calva. Is there a custom jack-in command that can make this work in Calva?
I don't know what is meant by a ”managed node-repl”. Neither what it means that ”the user is in control of the node process”.
I commented on the issue now and hopefully we can get some clarifications from Thomas.
Alright, so the issue (https://github.com/BetterThanTomorrow/calva/issues/1468) has new updates and at least we have a workaround.
Hi. Go to definition failed for Java libraries (both JDK and 3rd Java libs). Can some body confirm? Thanks
Jack-in deps were recently updated. It could be some change in cider-nrepl/orchard that broke something (just a guess).
I’ve experimented a bit with using the older versions, but it doesn’t seem to be about that.
Related issue (I think): https://github.com/BetterThanTomorrow/calva/issues/1486
My references tab doesn't seem to be working at all. Whenever I choose "Find all references" or "Open call hierarchy", it just looks like it is thinking and spins forever. Any clues or steps I should take to diagnose?
Do you have an open repl? Otherwise that information is coming from LSP
As far as call hierarchy, I think that only comes from clojure-lsp. Does clojure-lsp seem to be starting successfully? See here for info about troubleshooting (viewing messages between client/server and viewing the logs might help): https://calva.io/clojure-lsp/#troubleshooting
I found this, is it stale? https://github.com/BetterThanTomorrow/calva/issues/1069
Thanks. We’ve upgraded the client library since then. I think it did work in the past. I’ll have to check it out soon, or someone else can verify that it works for them.
@U01EB0V3H39 Do you know if it works for you?
It works for me. I was thinking “Find all references” comes from nrepl once it’s running, but I didn’t check myself.
Call hierarchy was working and then started this behavior a few days ago
Oh, and it seems once I do Call Hierarchy, it breaks the Find All References until I restart
so looks like Call Hierarchy breakage is having side-effects on the others
@U0564EGNY Please create an issue and add details such as the clojure-lsp messages and logs from after you experience the issue. See the link I sent above for that.
Alright, so the issue (https://github.com/BetterThanTomorrow/calva/issues/1468) has new updates and at least we have a workaround.