Closed adomurad closed 2 years ago
Hi there! So happy you want to try Clojure and that you choose to do it with Calva. And so sorry Calva is giving you troubles!
While we try to figure out what is going wrong, you can try it in the browser, avoiding any issues on your machine: https://calva.io/get-started-with-clojure/
When you issue the commands on your machine, do you see a Calva Jack in tab in the Terminal pane open?
No, I don't.
When I use any of those commands, nothing really happens (besides opening new files in the temp directory)
I did some reading and tried to launch my own repl with a socket, like this:
JVM_OPTS='-Dclojure.server.myrepl={:port,50505,:accept,clojure.core.server/repl}' lein repl
nREPL server started on port 53811 on host 127.0.0.1 - nrepl://127.0.0.1:53811 REPL-y 0.5.1, nREPL 0.8.3 Clojure 1.10.3 OpenJDK 64-Bit Server VM 11.0.2+9 Docs: (doc function-name-here) (find-doc "part-of-name-here") Source: (source function-name-here) Javadoc: (javadoc java-object-or-class-here) Exit: Control+D or (exit) or (quit) Results: Stored in vars 1, 2, 3, an exception in e
And in vscode I have launched the command: Connect to a running REPL, not in your project
and selected the Leiningen
option, typed in the correct port 53811
, and it works!
So the problem seems to be starting the repl by Calva...
If you have the developer tools open when you use any of those commands, do you see anything suspicious being logged?
I have checked the dev tools and there is an error in the console when trying to launch the Start a standalone REPL (not in project)
command.
There is nothing happening in the logs when trying to run Start your project with a REPL and connect (a.k.a. Jack-in)
- but not sure if I'm using this one correctly.
It would be super useful to see what [[Object Object]]
contains. 😄
Jokes aside, tricky trace to make something out of, especially since I can't find a reference to Calva code there. This is the first time I hear about this problem, and I can't reproduce it. If you have the time, it would be great if you can run Calva in development mode and try catch this thing in the debugger. It is actually pretty easy to get it running in development mode. Please see: https://github.com/BetterThanTomorrow/calva/wiki/How-to-Hack-on-Calva
OK, I will try to debug the issue in the next couple of days, and will post the results and any findings here 🙂
I did some debugging on the Calva vscode extension and I found the problem.
Basically one Promise
in function setupLiveShareListener()
was hanging (neither resolving nor rejecting):
liveShare = await vsls.getApi();
And after disabling both MS Live Share extensions, it started working :)
Thanks for all your help 🙂 I already have a good time playing with Clojure using Calva <3
That was quick!
Thanks for reporting this and helping to find the culprit. This could be a regression in Calva, or something that has changed in the LiveShare extensions. Very good that we know about it and can try fix it. At the very least we could timeout waiting for that promise to resolve or reject.
Must be a recent regression; I've had Live Share extensions enabled alongside Calva for months, but one of the Calva updates in the last few weeks probably broke compatibility, since I updated Calva today and found I couldn't start any REPLs in projects. (No errors logged, but the REPL started once I disabled Live Share.)
Live Share hasn't updated recently, AFAICT, although of course VS Code has.
@TuggyNE if you can bisect it and find where the regression happened, that would be very helpful! There's a cog wheel on the Calva item in the Extensions view that will let you use any previous version. At least it should be quick to check if the version you used last time it worked, still works. The changelog might help you figure out which version that could have been.
I also encountered the same issue yesterday, I couldn't start a REPL due to the live share API hanging indefinitely. It only just started happening for me yesterday, and I am usually on the latest version of Calva. I didn't spend too much time debugging, though I did try rolling back to 2.0.253 but still had the issue. But I've also been on at least that version or a more recent version pretty much all week. Disabling Live Share fixed the issue for me.
Aside from the obvious issue of the Live Share bug, what do you think about moving the Live Share setup lower in the REPL connection sequence? The most annoying part of this issue is that the editor just doesn't respond to your input. No connection sequence menu, no output in Calva Says, nothing. Maybe as a temporary fix also consider adding a timeout? I'm not sure what is happening under the hood with that Live Share API, is it making network requests?
Bad news: It seems to be a problem in LiveShare that is quite intermittent to its nature.
https://github.com/MicrosoftDocs/live-share/issues/4551
Good news: I finally am able to reproduce it. At least sometimes.
That upstream issue could also be what happens in #1625
Hello,
I've just started with Clojure and wanted to checkout the Calva extension for vscode.
In the output of "Calva says" I can see a message:
But it seems not to work at all... When I use the command: "
Start a standalone REPL (not in project)
" then a new file in a temp dir appears "user.clj" with the content(ns user)
" But no REPL window appears, and on the status bar I see: "REPL Disconnected".I have the same issue with the command: "
Calva: Fire up the Getting Started REPL
"I'm using MacOS Monterey and my java version is:
I did check all the output windows from vscode and didn't find any error with clojure nor the extension...
Can you help me with this issue? I would really like to start learning Clojure - and check what with the fuzz around the REPL in this community ;)