Fork me on GitHub
#calva
<
2020-10-07
>
stefan.van.den.oord07:10:12

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

pez08:10:05

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

stefan.van.den.oord09:10:46

IT WORKS! 🙂 🙂

stefan.van.den.oord09:10:54

Ok with the hacks in place, right 😉

stefan.van.den.oord09:10:22

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

stefan.van.den.oord09:10:45

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.van.den.oord09:10:09

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

pez09:10:15

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

stefan.van.den.oord09:10:30

I think I should be able to do that.

pez09:10:07

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

stefan.van.den.oord09:10:09

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.

stefan.van.den.oord09:10:21

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)

pez09:10:10

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

stefan.van.den.oord09:10:20

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?

pez09:10:07

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.van.den.oord09:10:20

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?

pez09:10:48

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…

pez09:10:50

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

pez09:10:09

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

stefan.van.den.oord09:10:58

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.van.den.oord09:10:44

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.van.den.oord09:10:25

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

pez09:10:32

Yeah, that might not be possible even.

pez09:10:07

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

stefan.van.den.oord09:10:45

“`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.van.den.oord09:10:28

Well, let’s make that version 2 😉

stefan.van.den.oord09:10:35

Anyway, duty calls. Later!

pez14:10:37

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

ccidral14:10:36

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.

pez14:10:21

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

ccidral15:10:06

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 😜

ccidral15:10:15

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

pez16:10:26

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

pez16:10:22

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

brandon.ringe16:10:54

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.

ccidral16:10:56

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

ccidral16:10:20

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

ccidral16:10:24

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.

brandon.ringe16:10:20

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

brandon.ringe16:10:50

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

brandon.ringe16:10:50

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

stefan.toubia16:10:34

think you’ve got the wrong guy!

pez17:10:42

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

brandon.ringe17:10:55

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

pez17:10:09

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

ccidral17:10:06

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

pez06:10:41

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

borkdude19:10:56

I guess the above also goes for Calva itself.