Just curious, are you connecting via the command "Connect to a running REPL Serve in the Project?"
I think as long as you have the browser open to your app, it should work
What are you currently experiencing when trying?
Hello again, Calva friends. I'm working on improving stack trace output, but also have done some refactoring regarding how/when the repl prompt shows in the output window, and some other things. Please try out this vsix with the current state of changes. https://8201-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.126-improve-stacktrace-output-bdc5fa30.vsix. The more testing with this the better. CC @ales.najmann The stack trace file locations aren't clickable yet, but will be. Here's the PR if you want to see the changes. https://github.com/BetterThanTomorrow/calva/pull/806
Wow, it's a lot better now. 👏 😊
...and for the first time I installed vscode extension from the side channel (I mean manual install)
It may also depend on if you started the repl with the deps Calva uses with jack-in. See here if you haven't: https://calva.io/connect/#connecting-wo-jack-in
If I try to jack in (or connect otherwise) absolutely nothing seems to happen. Where can I see logs for what is going on? Calva Connection Log is empty.
The Calva Connection Log is wrongly named. It is a log with output from the cljs repl startup process. Can you describe step by step what you do? What ui elements you use, buttons you click, etcetera. Maybe we can get some clues there. Also the dev console might print something. You open that from the help menu.
I’m looking. Just started code, went into Clojure mode and do CMD-SHFT-P, jack in.
I haven’t touched any of this stuff in a long time.
Now I tried reinstalling the extension and restarting code, and it says my Code is corrupt.
(Never happened to me before. Get a new Code and overwrite the one in my Applications folder.)
Something should show up in the Developer Tools Console?
@alper is this in a Clojure project?
It’s a clj file in Clojure mode.
Calva doesn't know how to jack in then. But it doesn't tell you that. It just silently quits trying. We should improve that.
I tried manually connecting to a lein I have running but that also does nothing?
What makes a project? I’m here from Getting Started: https://calva.io/workspace-layouts/
I think Calva doesn't handle that you don't have a project or workspace open.
We could probably fix that. In fact I think some of the work that @stefan.van.den.oord is currently doing might lead to this being easier to fix.
Ah ok. I think it needs a project.clj
looking through my old stuff.
Please file an issue about it. Calva should be able to connect from just a clojure mode file, I think.
I haven’t touched this in a while. I thought I’d just drop a clj file into my ~/Downloads
folder and start hacking a bit.
Yeah. I think it makes sense to expect that to work.
Done: https://github.com/BetterThanTomorrow/calva/issues/811
Cool. I copy pasted my old project file and moved the entire thing to a folder and now it’s kicking.
Thanks!
I’m not sure whether it’s possible to forego the stuff in the project file. It seems that most of it could be replaced with your lein
defaults?
Also this is a lot quicker than last time I tried it out.
Thanks!
@pez @brandon.ringe I got a question about my PR (https://github.com/BetterThanTomorrow/calva/pull/805):
Can somebody help me on how to deal with the quickPickSingle
and quickPickMulti
(in utilities.ts
)? They get a saveAs
string, which contains a path. This path is, I believe, used to remember the previous choice that the user made, so that it can be pre-selected in the UI. Currently this is a local path though, so I’m trying to work out how this should work in the remote case.
Should each user have its own version of that file? Should there be only one, which is used by all users? (race conditions!)
Can you use a stringyfied URI as the path, maybe? Iirc it is just used as a key.
Right it’s not actually used as a path but as a key into state.extensionContext.workspaceState
. Would that be safe to use by multiple users at the same time (i.e. writing to the same key)? Shall we just assume that?
When would it ever be accessed by more than one user?
I guess I just don’t know how the mechanism works and where it is stored. This Memento
thing is apparently some key-value store; where is it stored? If it’s always local on the user’s own machine then it’s OK.
I'm pretty sure it is a local thing.
Huh. Interesting. I just noticed that when I start a live share session in a jacked-in shadow-cljs-based project, the web server’s port 3000 is automatically shared over live share. Any idea what causes that?
I also want that for Calva’s CLJ nREPL port 🙂
Not sure if this explains it: https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/security#sharing-a-local-server > In Visual Studio Code, Live Share attempts to detect the proper application ports and share them.
@pez https://github.com/svdo/calva/commit/78d2dd79effb76e24639effe4e80d6c3f4c3302d 🙂 🎉
Haha, very cool!
Nice detail by the way: when using this vsls API, VSCode will automatically ask the user to allow sharing the port, so it’s also safe in that respect.
Yeah, that is nice. 👍
Probably yes, that’s a nice feature. I guess we’ll have to make nREPL work over HTTP :rolling_on_the_floor_laughing:
There is a HTTP transport for nREPL, but I'm not sure how to use it or if it is any good.
No just joking. But maybe at some point in the future we can do the same using the vsls API. But that’s not a priority for me at this point.
No. manually sharing the port is a minor thing and also feels much safer than automatic sharing.