Fork me on GitHub

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


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)


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?


OK, so yes....


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?


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


Help menu -> Show Developer Console


What do you see in the output panel, Calva says


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


Yes, maybe it hasn't started. 😃


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


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


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


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.


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


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


Did it complain about the terminal not starting?


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.


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.


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




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


But why....


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.


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


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


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


Help: Report issue?


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


Got it. Doing it now.


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:


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.


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


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.


> 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


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


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

calva 1

Thanks for helping with that!


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?


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.


I will when I get a test case to confirm.


Thanks! This us the previous issue I mentioned:

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


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


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


Thanks for the bug repport! Pasting it here for discoverability:


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


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 (


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


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. Looks like so:


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.

Ben Wadsworth13:03:28

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


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