rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Feature request, code lens run in release mode

Open jacobrosenthal opened this issue 4 years ago • 2 comments

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?

jacobrosenthal avatar Aug 20 '20 05:08 jacobrosenthal

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

eminence avatar Apr 22 '21 03:04 eminence

Yes please!! Release build can make a huge difference for GUI apps, where it's not mostly about IO performance.

yay avatar Aug 06 '22 17:08 yay

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

yay avatar Dec 24 '23 15:12 yay

CC https://github.com/rust-lang/rust-analyzer/issues/16047

@yay as a workaround, you can also tweak the build mode in Cargo.toml.

lnicola avatar Dec 24 '23 15:12 lnicola