Unnamed repository; edit this file 'description' to name the repository.
fix: use package id as argument to `--package` if package is not unique
| -rw-r--r-- | crates/rust-analyzer/src/target_spec.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/target_spec.rs b/crates/rust-analyzer/src/target_spec.rs index 81d9786809..8e57d2df52 100644 --- a/crates/rust-analyzer/src/target_spec.rs +++ b/crates/rust-analyzer/src/target_spec.rs @@ -319,7 +319,11 @@ impl CargoTargetSpec { pub(crate) fn push_to(self, buf: &mut Vec<String>, kind: &RunnableKind) { buf.push("--package".to_owned()); - buf.push(self.package); + if self.package.contains(":") { + buf.push(self.package_id.to_string()); + } else { + buf.push(self.package); + } // Can't mix --doc with other target flags if let RunnableKind::DocTest { .. } = kind { |