Fork me on GitHub
#calva
<
2019-05-31
>
pez04:05:27

Great news to wake up to! 😀

pez04:05:09

I'm not sure I follow about the task manager and which window is the one with the running java process. Closing the repl windows should not close any tasks, though.

lilactown05:05:20

How should people stop the jack-in task then?

pez10:05:50

The task can be terminated in several ways. Closing the project in vscode, using the Terminate Task command, or typing ctrl+c in the terminal running the task. Also running jack-in again will first terminate the current jack-in.

pez11:05:07

There's a new build in town. A nice guy sent in some PRs regarding styling of the repl prompt and the cursor. So now it doesn't glitch like it did when matching parens, but instead actually matches them, for instance. Also the cursor doesn't stress you out like before. I've also removed most of the how-to copy, becuase it got too much, imo.

pez11:05:38

I have gotten reports that the paredit commands start and stop working in mysterious ways both in the regular editors and in the repl window. I know exactly which piece of the code that fails me here, but continue to fail getting it right, appearantly. Quite strange that it behaves so differently on different machines. But anyway, my request for some pair programming partners from yesterday still stands. I think an extra brain on this will have it nailed in a jiffy.

dominicm15:05:13

@pez what is the code like for this paredit stuff? I tend to be a good second pair of eyes. I don't know the context here though :)

pez16:05:06

Awesome! This is not the Paredit code, per se, but rather how we capture the commands and send them to the right place. When the REPL window is active, it should have the commands, otherwise they should go to the active editor. What goes wrong is that we fail when figuring this out. At the very beginning of repl-window.ts there is this code:

export function activeReplWindow() {
    for (let w in replWindows) {
        if (replWindows[w].panel.active)
            return replWindows[w];
    }
    return undefined;
}
Which was a bit more complicated two days ago, while not quite working. I changed it to the above yesterday and it worked swell on my machine, but, yeah, it doesn’t work on all machines…

pez16:05:18

Figuring out how that function should work involves wrapping ones head correctly around the vscode APIs. But I am starting to suspect we need to solve it some other way, because this function is hit quite often from different places. In any case, it still requires figuring out things about the vscode API.

dominicm21:05:41

What's happening on some machines?

dominicm21:05:52

What does active mean in this context?

dominicm21:05:02

How does something become active?

pez05:06:26

Active means ... Hmmm, that if I type something it will appear in the active pane.

pez05:06:15

I am not sure it is a machine thing, it could also be that I just haven't figured out when the bug appears. You can check if you have the condition by issuing Paredit expand selection (`ctrl+w`) in the repl window and in an editor pane.

dominicm06:06:26

What's the difference between active and focused? The vscode api mentions both.

dominicm06:06:53

But also, what's the bug? What are people reporting?

pez07:06:46

I'm not sure what the difference would be.

pez07:06:30

The bug is that paredit commands stop working.

dominicm08:06:52

Can users poke at these variables when this happens?

dominicm08:06:16

Well, can they poke at replWindows specifically

pez09:06:35

The only way to poke at that is to open or close repl windows. And there is only ever one repl window per “type” (`clj` or cljs).

pez09:06:16

If you have some time for a voice chat, I have too, at least right now.

dominicm13:06:27

So my suspicion is that replWindow is in a bad state somehow. I'm not sure what populates it. But a start might be a debug log from wherever it is updated, and some way in vscode to open a developer console and access that variable.

pez13:06:49

It is just a map from type (`"clj"` or "cljs") to instances of REPLWindow. And it is only manipulated when the window is created and when it is closed. I’ve checked it, it contains what it should contain (two REPLWindow instances) even when the bad behaviour shows up.

dominicm13:06:48

And are either of them active?

pez14:06:54

That is a bit trickier to determine. The function is hit a few times in the transition when the user moves the focus. And on my machine things work and I can’t make it not work…

pez14:06:40

But on my machine it is hit trice. First time the window has the active state it had before the user action, the second and third time it has the new active state. I should go check up that thing with focused you mentioned…

dominicm14:06:05

It's a shame you can't poke at the var, JavaScript is a very live environment.

pez14:06:06

How do you mean I should poke at the var? I can probably try to do that somehow…

dominicm16:06:37

Like opening a console in the browser, and doing global.replWindows

pez11:05:14

Generally, the whole state management of Calva is a mess and a source of so many errors. When Calva 2 is out, first thing must be to clean that up. If some of you guys consider yourselves to be decent architects, I will appreciate some help with that then. Think about it, please.

pez11:05:48

(I'm just a poor product owner, remember?)

orestis11:05:21

@pez Just let us know when the release is out! I’d like to go over the code at some point 🙂

pez11:05:59

ETA mid next week. 😃

pez12:05:03

Pondering a thing here... Calva + Clojure Warrior and you're set is quite nice. But VS Code allows me to bundle extensions. So instead of telling people to also install Clojure Warrior, maybe I should just bundle it? This would also be a way to handle when I evict the linter from Calva, a move enabled by @marc-omorain, who is going to make a separate extension for that. Calva can bundle that extension. So installing Calva will give you everything you need, REPL, formatter, Paredit, linter, visual paren matching... I think that would be the best beginner experience. What do you guys say?

slack103812:05:43

Yes think it will help when everything you need to start gets bundled. Makes also easier to tell someone how to start 🙂

pez12:05:52

Haha! That's how I arrived at the thought. I was writing on a ”how to start” text.

orestis14:05:40

Hm, I like the idea of bundling everything in an easy to use extension. What about having also the option to install just “Calva Core”?

orestis14:05:59

(Where Calva Core = REPL stuff only)

pez14:05:56

That's a bit what we have today. It's confusing for many users and a bit of a maintenance hell for me, so that's why Calva 2 goes in the other direction. But who knows if we find the right lines to separate things along it might be easier.

pez18:05:54

@slack1038, so we don’t have a quoting problem, as far as you know?

pez18:05:45

Also, I’d like to figure out if we have a zombie problem, or if it that something that can be taken care of with better information to the users.

slack103821:05:47

@pez the quoting is with powershell still a problem (at least for me) Zombie: it seems to work fine when i close/terminate like you said at least for jack-in dont know how to do it when i connect to a nrepl currently i just close the window but i have the feeling that the connection is still open 😅