I recall that extensions can contribute tasks, and I believe RLS supports something like this. It would be nice if we could do the same thing. We do have a "Rust Analyzer: Run" command, but it's not integrated with Code and it only seems to support
The probelm is that Code's tasks are wrong :D
They don't have access to the current context, so you can't really "run this test"
I'm thinking more of "Run project", assuming you only have one binary in the project or workspace. Or "Debug project" which is even more of a mess currently.
Yeah... I am not sure that's actually useful for non-trivial projects...
Creating default actions works if there are few actions. If there are many (and there are many for real projects), that's just bad UX.
What would work is an input box for entering
cargo comands, which has completion, and which smartly remmebers last/predefined commands. Basically, exactly how IntellliJ's run configuaration infra works
It's helpful for beginners -- "I installed this Rust IDE thing and it doesn't even let me run my programs"
And a RLS feature parity gap:
Yeah, that's true
I guess just irrationally dislike implementing features in less than ideal way :)
TBH, for simple stuff I liked the VS experience (hit Ctrl-F5, current project runs) better than the IntelliJ one (open project settings, add a configuration etc.)
IntelliJ wins if you need to run different things, change the command line arguments and so on. But most often I didn't need that.
Never used code tasks,
npm run stuff or
cargo xtask stuff is everything I need
could we have a global "cargo run" command that asks you which binary to run if there are multiple options?
I guess tasks can't run commands...
Apparently in RLS you can click the settings icon and you'll get a snipped added to
tasks.json, which you can then customize
oh, that's pretty similar to intellij, isn't it (at least how I know it from java)
Ah, nifty, I think RLS registers a new task type (
cargo) and you can have custom attributes like