diff options
author | o0Ignition0o <[email protected]> | 2020-03-31 08:39:04 +0100 |
---|---|---|
committer | o0Ignition0o <[email protected]> | 2020-03-31 13:43:39 +0100 |
commit | 331d1db3174853a435991c9341367c235e89eca4 (patch) | |
tree | 84a2bab2fe9c53afb4f7503c68f44610b8f4d2a2 /crates/rust-analyzer/src/cargo_target_spec.rs | |
parent | 668980d8657bd358b83f74e2f54f5e228f7393ed (diff) |
Add crate versions when running cargo -p commands.
Until now cargo commands with the -p flag would pass the package name only.
It doesn't play super well with the toml Renaming dependencies feature.
This commit specifies the package name and version when a cargo command is run with the -p flag,
to avoid ambiguities.
Diffstat (limited to 'crates/rust-analyzer/src/cargo_target_spec.rs')
-rw-r--r-- | crates/rust-analyzer/src/cargo_target_spec.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/cargo_target_spec.rs b/crates/rust-analyzer/src/cargo_target_spec.rs index f87bdcec5..942c30328 100644 --- a/crates/rust-analyzer/src/cargo_target_spec.rs +++ b/crates/rust-analyzer/src/cargo_target_spec.rs | |||
@@ -77,7 +77,7 @@ impl CargoTargetSpec { | |||
77 | ProjectWorkspace::Cargo { cargo, .. } => { | 77 | ProjectWorkspace::Cargo { cargo, .. } => { |
78 | let tgt = cargo.target_by_root(&path)?; | 78 | let tgt = cargo.target_by_root(&path)?; |
79 | Some(CargoTargetSpec { | 79 | Some(CargoTargetSpec { |
80 | package: cargo[cargo[tgt].package].name.clone(), | 80 | package: cargo.package_flag(&cargo[cargo[tgt].package]), |
81 | target: cargo[tgt].name.clone(), | 81 | target: cargo[tgt].name.clone(), |
82 | target_kind: cargo[tgt].kind, | 82 | target_kind: cargo[tgt].kind, |
83 | }) | 83 | }) |