When running jack in and selecting shadow-cljs it ends up running "npx <".
Running on Linux.
Task output:
> Executing task: npx <
ERROR: You must supply a command.
Execute binaries from npm packages.
npx [options] <command>[@version] [command-arg]...
npx [options] [-p|--package <package>]... <command> [command-arg]...
npx [options] -c '<command-string>'
npx --shell-auto-fallback [shell]
.....
Thanks! What shell do you use as default in VS Code?
My default shell is fish
Edit: Changed my shell in VSCode to bash but still have the same problem.
Thanks for making that test. It was the next thing I was going to ask you to do of course. :smile: Now I am out of ideas. But also, I am looking a bit more closely on the output you have provided. It doesn't look like a quoting issue at all (which I initially thought it might be).
Some more questions then:
The version is 2.0.31
I do get the popup asking which build to use
edit: the dependency issue is unrelated, I'm still reproducing the issue with a valid shadow-cljs config.
@Tebro By any chance, do you have some dependency name as string? e.g.:
{:source-paths
["..."]
:dependencies
[["whatever.awesome/dependency" "x.x.x"]] ; <- Here, double-quotes around the name
:builds
{}}
In which case, does turning it into a symbol fix the issue? e.g.:
{:source-paths
["..."]
:dependencies
[[whatever.awesome/dependency "x.x.x"]] ; <- Same without the double-quotes for name
:builds
{}}
I believe I switched between mouse and keyboard without thinking about it to select the build(s) while trying to reproduce the issue...
What seems to work every time:
What seems to fail every time:
Mouse-selected build(s) are automatically selected on next run, I believe this is was the error was magically disappearing, even when using the keyboard.
I'll try to reproduce in debug mode this evening to make sure it actually produces the broken build data that makes the npx command fail.
Thanks! I can reproduce this on my Mac now. Or something similar to it:
So, at least on Mac, the UI seems to be designed such that enter submits the menu and mouse click on a menu item toggles it. space is used for toggling the selection using the keyboard.
The real bug here is that Calva does not validate the selection.
When opening the command palette with ctrl+shift+p, typing a few chars + some arrow keys to retrieve the Jack-in command, then validating with enter, the build selection box shows at the same place and also looks like some kind of drop-down menu, so couldn't one easily assume builds can be selected the same way as commands?
Also, when typing esc from the build selection box, the npx command is run (ending up with the same error).
Would making those small UX improvements be valuable?
The menu is a built in vscode widget, and I don't think it allows for altering that behaviour. The difference between the builds menu and the Jack-in project type menu is that the builds menu allows multiple selections. So there is an OK button there which is bound to the enter key.
Here's the API for the QuickPick widget: https://code.visualstudio.com/api/references/vscode-api#QuickPick
I have added some validation for this in the branch were we are reworking much of the jack-in code. It now aborts the jack-in when there is no build selected, including when esc is pressed. That's better, but there will still be a problem for when the user wants to select more than one build and presses enter on the last one, thinking that selects it, a situation I can't detect. But maybe, by then the user has learnt how the UI works.
Reading through this it makes sense, I no longer use VSCode for Clojure (for other reasons), but good to know this helps others.
What are you using instead, if I may ask?
VIM.
Edit: Calva is better Clojure tooling, but is not compatible with the VSCode VIM plugin which in itself is already a step down from just vim. So after weighing all of these points I ended up going back.
Thanks for clarifying it a bit. I didn't know Calva and the VIM Plugin were incompatible. Is it something else than what is covered here?
(As an old vi user, I often have found the vi modes in other editors quite underwhelming, evil mode in Emacs being an exception.)
In my opinion the paredit part is fundamentally incompatible with (at least my style of) vim editing. I tried to go without the vi mode, but it seems I can no longer function without it.
I agree with your comment about evil being the only vi mode that works well.
If you have some time, I'd like to chat some about this. Not sure I can do very much about it, but at least I'd be more informed about the problem. You'll find me as @pez on Clojurian's Slack.
Closing this, as there is not very much we can do about it at the Calva end of things.
Most helpful comment
Thanks! I can reproduce this on my Mac now. Or something similar to it:
So, at least on Mac, the UI seems to be designed such that enter submits the menu and mouse click on a menu item toggles it. space is used for toggling the selection using the keyboard.
The real bug here is that Calva does not validate the selection.