calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
Stefan 2020-10-07T07:49:12.162200Z

@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.

pez 2020-10-07T08:41:05.162900Z

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

Stefan 2020-10-07T09:18:46.167200Z

IT WORKS! 🙂 🙂

👏 1
🎉 2
Stefan 2020-10-07T09:18:54.167500Z

Ok with the hacks in place, right 😉

Stefan 2020-10-07T09:19:22.168Z

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

Stefan 2020-10-07T09:29:45.169800Z

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…

Stefan 2020-10-07T09:30:09.170400Z

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

pez 2020-10-07T09:35:15.171200Z

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

Stefan 2020-10-07T09:35:30.171500Z

I think I should be able to do that.

pez 2020-10-07T09:36:07.172700Z

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

Stefan 2020-10-07T09:36:21.173Z

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)

Stefan 2020-10-07T09:37:09.173400Z

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.

pez 2020-10-07T09:38:10.174300Z

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

Stefan 2020-10-07T09:39:20.175100Z

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?

pez 2020-10-07T09:42:07.175200Z

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.

Stefan 2020-10-07T09:43:20.175400Z

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?

pez 2020-10-07T09:44:48.175600Z

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…

pez 2020-10-07T09:47:50.175800Z

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

pez 2020-10-07T09:50:09.176Z

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

Stefan 2020-10-07T09:51:58.176200Z

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.

Stefan 2020-10-07T09:52:44.176400Z

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.

Stefan 2020-10-07T09:55:25.176600Z

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

pez 2020-10-07T09:56:32.176800Z

Yeah, that might not be possible even.

pez 2020-10-07T09:57:07.177Z

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

Stefan 2020-10-07T09:57:29.177200Z

Hmm maybe something is possible: https://www.npmjs.com/package/vsls

Stefan 2020-10-07T09:57:45.177500Z

“`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: […]”

Stefan 2020-10-07T09:58:28.177800Z

Well, let’s make that version 2 😉

Stefan 2020-10-07T09:59:35.178Z

Anyway, duty calls. Later!

pez 2020-10-07T14:44:37.181300Z

@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.

Célio 2020-10-07T14:53:36.184300Z

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.

pez 2020-10-07T14:58:21.186300Z

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. 😃

Célio 2020-10-07T15:23:06.188200Z

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 😜

Célio 2020-10-07T15:37:15.190500Z

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).

pez 2020-10-07T16:09:26.191100Z

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

pez 2020-10-07T16:11:22.191800Z

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

bringe 2020-10-07T16:13:54.194200Z

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.

Célio 2020-10-07T16:34:20.198300Z

@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.

Célio 2020-10-07T16:36:56.198400Z

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

👍 2
Célio 2020-10-07T16:39:24.200300Z

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

😮 2
bringe 2020-10-07T16:40:20.200700Z

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

👍 1
🎉 1
bringe 2020-10-07T16:55:50.202100Z

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

Stefan T 2020-10-07T16:59:34.202300Z

think you’ve got the wrong guy!

pez 2020-10-07T17:07:42.203200Z

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

bringe 2020-10-07T17:09:55.203400Z

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

pez 2020-10-07T17:34:09.205200Z

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

Célio 2020-10-07T17:37:06.205400Z

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

borkdude 2020-10-07T19:20:51.208300Z

🎉 1
borkdude 2020-10-07T19:23:56.209Z

I guess the above also goes for Calva itself.