Fork me on GitHub
#calva
<
2022-03-08
>
Gunnar10:03:53

Is it OK to ask for some basic startup help here? I have added the plugin but I am getting "command not found" for any/all attempted Calva command in VS code. (E.g. opening Getting Started REPL, or jack-in) It should "just work" right? I don't know where to start fixing this...

Gunnar10:03:08

OS: Linux, VS Code v1.55.2, Calva plugin v2.0.252 $ java --version openjdk 17.0.1 2021-10-19 OpenJDK Runtime Environment 21.9 (build 17.0.1+12) OpenJDK 64-Bit Server VM 21.9 (build 17.0.1+12, mixed mode, sharing) I simply CTRL-P, "Fire up the Getting Started REPL". Result: Command 'Calva: Fire up the ”Getting Started” REPL' resulted in an error (command 'calva.startStandaloneHelloRepl' not found)

pez10:03:09

Hello and welcome! Yes, this is the place to ask for help. And yes, it should just work. So, you see those commands in the command palette, but they give you ”command not found” when you use them?

pez10:03:01

OK, so yes....

Gunnar10:03:54

I'm kind of new to VSCode also, don't know all the tricks. Is there a terminal window or log I should open or something for more info?

pez10:03:19

I do recognize this problem, but right now I draw a blank... Do you see some error in the Developer console when Calva starts?

pez10:03:36

Help menu -> Show Developer Console

pez10:03:58

What do you see in the output panel, Calva says

Gunnar10:03:03

Um... Is that the Debug Console? Don't see Developer Console. Also, "when Calva starts". Maybe it hasn't started...

pez10:03:22

Yes, maybe it hasn't started. 😃

Gunnar10:03:27

It starts when I take an action like open Getting Started REPL I guess, or do I need to do something more?

pez10:03:51

Toggle Developer Tools is the menu item. Sorry for the confusion.

Gunnar10:03:06

Aha, yeah like I said totally new to VS code. I'm a VIM guy 🙂

pez10:03:04

Starting the Getting Started REPL should trigger Calva to start, but it might also have been started before. Depends if you have a project with clojure stuff opened or not.

Gunnar10:03:16

Some complaint about terminal. Let me restart VS Code to get a clean log and report back

pez10:03:36

Good to know that you are new to VS Code, then I won't seem so patronizing, hopefully. 😃

pez10:03:58

Did it complain about the terminal not starting?

Gunnar10:03:35

Kind of but I think it was unrelated. Here are the errors after a clean start: • /usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:62 [Extension Host] (node:2180444) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. • /usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:62 /usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1904 Activating extension 'betterthantomorrow.calva' failed: Cannot read property 'createTestController' of undefined.

pez10:03:42

Each VS Code window is a separate ”container” for extensions, btw. So if Calva could be started in one window, but not in another. Opening a blank window should leave Calva not started.

1
pez10:03:35

Cannot read property 'createTestController' of undefined.
This could be the problem. Let me check if I have a message like that.

Gunnar10:03:56

_logMessageInConsole@/usr/share/code/reso…esktop.main.js:1904

pez10:03:36

I don't have that message, so now I suspect that this is where things go wrong for you.

pez10:03:52

But why....

pez10:03:29

Can you file an issue on Calva about this? Please do it from the Help menu in VS Code. That will attach some system info to the issue.

Gunnar10:03:32

😬 Probably something silly... it usually is. Maybe my Java setup is no good. I just know it's there and java --version can be run, as shown above.

Gunnar10:03:09

OK... let me see, you might have to guide me through it.

pez10:03:11

It is not about Java. This happens before Java is needed.

Gunnar10:03:34

Help: Report issue?

pez10:03:58

Yes. Help menu -> Report Issue -> File on an Extension -> Calva

Gunnar10:03:19

Got it. Doing it now.

pez10:03:06

Since Calva fails to start there is really nothing you can do. We need to do something (first figure out what). I will of course prioritize this, and will try get your assistance. Can't jump on it right now, because need to work for food. However, you can run Calva and the Getting Started REPL in the browser: https://calva.io/get-started-with-clojure/

pez10:03:07

I just tested, and it works. It is running on a Linux machine in the cloud, so I got worried it might also be broken.

pez10:03:32

The issue says you are running version 2.0.244 of Calva. Not that I think it matters. But anyway.

Gunnar10:03:39

No problem. I have other things to work on and/or use a simpler environment for my clojure stuff for a while. I think I want to settle on VS Code / Calva in the long run though.

Gunnar11:03:55

> The issue says you are running version 2.0.244 of Calva. Not that I think it matters. But anyway. That's really odd. I copy-pasted the version number from the plugins page and it said it was installed so I assumed...maybe I got confused and copied what was the latest version. I just uninstalled and installed again. Problem remains in 2.0.252

pez11:03:06

Yes, this test ui stuff that I am suspecting, was introduced with v2.0.233. Please test with 232 if you have the time.

Gunnar11:03:24

Done, it works, and I can now use 232 for the time being. Thanks.

calva 1
pez11:03:28

Thanks for helping with that!

fadrian10:03:32

I've upgraded to the latest version (2.0.252), but I'm seeing glitches with unbalanced list delimiters (parens/brackets/braces/etc.). When this happens, rainbow parens turn white, the backspace and delete keys become inoperable, the system shows errors about mismatched delimiters, and these errors cannot be cleared without deleting the code in question and restarting VSCode with code that has matching parens. I'm sorry that I can't give a case that displays this, but it seems to happen when I've happened to use cuts/pastes rather than the structural editing commands and the structure becomes unbalanced for a time. Adding delimiters to rebalance the delimiters on the expression doesn't seem to clear the errors. Has anyone else seen these behaviors recently? It seems to have started a little less than a week ago. Any ideas how to fix this?

pez10:03:31

We had a similar issue recently. That one was fixed, but it seems we still have work to do. Please see if v2.0.249 of Calva works better. And please file an issue on Github.

fadrian12:03:22

I will when I get a test case to confirm.

pez12:03:08

Thanks! This us the previous issue I mentioned: https://github.com/BetterThanTomorrow/calva/issues/1573

Ben Wadsworth16:03:09

This has been a pain in my butt for a few days! 😄 v2.0.249 works though so I downgraded and am happy lol. My test case to see if it is working is to write (let [a "123"] a) Move cursor to right side of ] then delete till you only get (let [a] a) then I highlight and delete the ] and boom, broken

pez16:03:08

Thanks @bwadsworth! Please file an issue. I'll have a look at this now.

pez17:03:31

I can't reproduce it like that, though...

pez17:03:18

Thanks for the bug repport! Pasting it here for discoverability: https://github.com/BetterThanTomorrow/calva/issues/1585

pez18:03:20

I have updated the issue with a repro that works for me.

Ben Wadsworth18:03:09

I’ll take a look w/ the debugger soon hopefully 🙂 odd you couldn’t reproduce with my steps. It is reproducible on more than just my machine but also my colleagues at work. Thanks for taking a look though

pez20:03:05

I have some kind of repro now. But it is not certain it is the same issue, so if you find time to investigate, that is very helpful. I'll keep the issue updated with what I find out.

Ben Wadsworth21:03:10

backwardListOfType is certainly caught in a loop. I am not of course familiar with what the valid inputs or expectations are in my short time investigating. But my editor has (_let_ [a a) _cursor_.getPrevToken()._raw_.endsWith(openingBracket) .getPrevToken() is identifying [ as the prevToken token before my cursor and then it checks if it ends with (

pez21:03:45

Awesome. You're hired! 🙏

Ben Wadsworth21:03:07

errr so _cursor_.backwardList() is always true and _cursor_.backwardUpList() is always false and _cursor_.getPrevToken()._raw_.endsWith(openingBracket) is always false

Ben Wadsworth21:03:56

haha well I didn’t do much 😕 I rather keep working almost solely in Clojure so I think I’ll pass 😉 happy to help - I’ll keep looking as I have time. But it isn’t clear to me exactly what the correct behaviors should be

Ben Wadsworth21:03:25

Also the fact I can reproduce it off the dev branch makes me think maybe the steps I posted were not followed? Forgive me if you are absolutely certain that you did 😄 maybe I am special haha. But when I was originally debugging the issue and trying to find what caused it, it had to be that absolutely exact case (minus the length of the string). I used no paredit keybindings and I think the overall important thing is highlighting that last bracked and deleting it

pez06:03:39

I might have misinterpreted your repro. The one I tried is described in a file on the branch where I'm trying to fix the bug. https://github.com/BetterThanTomorrow/calva/commit/058be6a1e7bc1c72fa97fa03ce6d9cd966912b90 Looks like so:

pez08:03:00

Here's a VSIX fixing the issue as reproduced by me. I Think it should fix it for you as well @fadrian and @bwadsworth , but since I can't even repro the same way, who knows. https://19183-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.253-1585-another-unbalance-hang-1b2e276a.vsix

Ben Wadsworth13:03:28

I just pulled dev and can no longer reproduce the issue 🙂 so it is at least fixed in that regard

pez13:03:38

Thanks for the help finding the root cause! 🙏 ❤️