Fork me on GitHub

@pez Just a quick heads-up: I’m making some steps forward on the REPL-over-live-share feature. With a bit of hacking, I got a REPL connection now. And I even see in the debugger that a form is evaluated. The output is not showing in the editor though (the overlay or whatever it’s called), so I’m going to try and find where that happens.


Sound great! Do you see the output in the output/repl window?



👏 3
🎉 6

Ok with the hacks in place, right 😉


But still, I see the output of eval current form and also eval to comment 🙂


Challenge to make this nice is to decide how to deal with this:

const PROJECT_DIR_KEY = "connect.projectDir";
const PROJECT_DIR_URI_KEY = "connect.projectDirNew";

export function getProjectRoot(useCache = true): string {
    if (useCache) {
        return deref().get(PROJECT_DIR_KEY);

export function getProjectRootUri(useCache = true): vscode.Uri {
    if (useCache) {
        return deref().get(PROJECT_DIR_URI_KEY);
The old getProjectRoot returns a local string that is not usable in remote cases. But I suspect replacing it all over the place with the Uri version is quite the task. I’ll try to get a feeling of how “doable” that is. For example, I’m looking at quickPickSingle which has a saveAs (is this used as a temporary file?). If you do that on the remote with multiple people at the same time, maybe everyone should have their own file instead of all the same one. I can imagine that such cases exist in Calva, but I don’t have the overview of the code base required to judge that…


I think I’m also going to create a WIP pull request for the changes that I’m making?


I prefer a draft pull request, if that option is available to you. (If not I will try to make it available.)


I think I should be able to do that.


Awesome that you have this progress! I think it is not too much work to make it a Uri everywhere.


Maybe not, but like I said we should probably see case-by-case whether using the remote with multiple people at the same time will work or not.


Also, a more strategic question: in the live share scenario, which jackin/connect types should be available? I’m thinking only the one through a shared point, so not the UI where you can select one (lein, deps, etc)


I think that maybe the project type determines where to look for the port file.


Currently yes, but in the remote case? I’m referring to the guest side, by the way. For the host things won’t change, but the guest should probably ONLY be able to connect to the host’s REPL?


I might be thinking about it the wrong way, but shouldn’t the connect be “as if” it was a local repl? I mean, to Calva it will look like the project is local, right? So then looking for the repl port there would pick up the port number from the host’s repl-port file.


For detecting the port file you’re right. But it’s not like you can choose to setup a different kind of REPL with different aliases or something, right?


You never can do that in a connect scenario, can you? I should really know this, but it is all quite fuzzy to me right now…


In cljs scenarios you can switch builds. Maybe that does not make sense when over liveshare…


So for the guest maybe it makes sense that when liveshare is detetected that calva doesn’t care about project type stuff.


Yeah that’s what I mean. Jack-in should not be possible (which will eliminate some user confusion), and connecting should automatically use the live share port. I never used any of the CLJS stuff so I don’t know how that works at all.


It would also be cool if we could setup a shared server in live share automatically when Calva detects that live share is used on the host side, but that may run into some security-related boundaries I suspect.


As in: sharing a port should be done by a user, not automatically without them knowing about it.


Yeah, that might not be possible even.


If it was possible we could support jack-in, I think. 😃


Hmm maybe something is possible:


“`shareService()` - Provides a named RPC service to guests. The service is made available only while a Live Share session is active in the Host role. The returned `SharedService` object has the following methods: […]”


Well, let’s make that version 2 😉


Anyway, duty calls. Later!


@ccidral it is very strange. I am also using Catalina, so I know that it is should work. But I am out of ideas about where to look for the problem. All I can offer now is to have a video/screen sharing session and reason and experiment a bit together with you. Let me know if that would work for you and what time would work.


Thanks so much @pez for offering to help, that’s very kind! I want to be mindful of your time, so I’ll try a few things before, like e.g. trying with a clean vscode installation, and then if the issue persists I’ll come back to you.


I appreciate the respect for my time. FYI I would think it well spent time to figure this out. We can then update the docs and help users. Your call, as long as you promise to tell us if and how you solved it. 😃


Good point! I promise that. Let me just bang my head against the wall a little bit more and then we can have joint debug session 😜


So I just tried Calva key binding ctrl+alt+c with a clean vscode installation but the issue persists. @pez Please let me know when you want to have a screen sharing session. I’ll be available today from 6pm thru 7pm (your local time).


So, that’s now. 😃 I’ll check with my wife if it works.


Reluctantly on her part, but let's do it anyway. haha. I'll DM you.


Not using mac myself, isn't the alt key on mac option ? So would the key binding be ctrl+option+c? I'm guessing everyone knows this though and it's not the issue, but worth making sure the right keys are pressed 😄 . If so, carry on! Just wanted to throw that out there just in case.


@U9A1RLFNV That’s correct, alt and option are the same key. To call it alt is a “windowism” 😄

👍 6

@pez and I just spoke and found something interesting. Any combination of ctrl+alt+<key> doesn’t work unless I hold the fn key pressed together. And that goes for any key bindings, not only Calva’s. So to anyone else having this issue please try fn+ctrl+alt+<key> . I’ll keep you posted if I find a solution. Again thanks so much @pez for your time, that was very kind.


Haha, just found the culprit, it’s I’ve been using it for ages. Once I closed Magnet, the key binding started working without the fn key.

😮 6

Great find! This should be added to the docs for sure

👍 3
🎉 3

@stefan.van.den.oord Love to see the work on live share! Looks like good progress.

Stefan T16:10:34

think you’ve got the wrong guy!


Haha, yeah so that's @stefan.van.den.oord 😍


Oops! 😂 Great job @stefan.van.den.oord I meant!


Ah, @ccidral , I also use Magnet. But I have disabled all its shortcuts.


It has an option to “ignore” apps, so its shortcuts are disabled on a per-application basis.


Yeah, I like to have it activated while using VS Code.


I guess the above also goes for Calva itself.