Unnamed repository; edit this file 'description' to name the repository.
fix: prefer bench command when target is bench to avoid cargo run
| -rw-r--r-- | crates/rust-analyzer/src/target_spec.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/rust-analyzer/src/target_spec.rs b/crates/rust-analyzer/src/target_spec.rs index 81d9786809..31f798d0c9 100644 --- a/crates/rust-analyzer/src/target_spec.rs +++ b/crates/rust-analyzer/src/target_spec.rs @@ -153,6 +153,9 @@ impl CargoTargetSpec { Some(CargoTargetSpec { target_kind: TargetKind::Test, .. }) => { config.test_command } + Some(CargoTargetSpec { target_kind: TargetKind::Bench, .. }) => { + config.bench_command + } _ => "run".to_owned(), }; cargo_args.push(subcommand); @@ -225,6 +228,9 @@ impl CargoTargetSpec { Some(CargoTargetSpec { target_kind: TargetKind::Test, .. }) => { (config.test_override_command, None) } + Some(CargoTargetSpec { target_kind: TargetKind::Bench, .. }) => { + (config.bench_override_command, None) + } _ => (None, None), }, }; |