rust-analyzer
rust-analyzer copied to clipboard
Feature request, code lens run in release mode
My runner is generally dfu a binary to a device so Id like to be in release mode. I suppose I could just override the debug release mode, but it feels meh.
I searched config a bit and thought I had to ideas, but they didnt seem to work
rust-analyzer.cargoRunner takes an extension name, not a local exe so I cant sneak cargo run --release there
I realized I could sneak an environvariable with runnableEnv but I think its not being injected to cargo, only the result "rust-analyzer.runnableEnv": { "PROFILE": "release" }
Thoughts?
I'm also interested in this.
Two possible implementations come to mind:
- A configuration change that will change the "Run" lens to run in release mode.
- Adding a new lens for a run in release mode, so we would see 3 options above the
fn main()
:
🢒 Run | Run Release | Debug
Yes please!! Release build can make a huge difference for GUI apps, where it's not mostly about IO performance.
I find that for me this is good enough. With this the Run
lens runs with --release
flag and if you want to run with debug just run the Debug
lens with no breakpoints.
CC https://github.com/rust-lang/rust-analyzer/issues/16047
@yay as a workaround, you can also tweak the build mode in Cargo.toml.