mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 17:28:09 +00:00
Treat path dependencies like workspace members
This commit is contained in:
parent
3dae94bf2b
commit
8a4c35a068
1 changed files with 3 additions and 3 deletions
|
@ -296,19 +296,19 @@ impl CargoWorkspace {
|
||||||
let mut packages = Arena::default();
|
let mut packages = Arena::default();
|
||||||
let mut targets = Arena::default();
|
let mut targets = Arena::default();
|
||||||
|
|
||||||
let ws_members = &meta.workspace_members;
|
|
||||||
|
|
||||||
meta.packages.sort_by(|a, b| a.id.cmp(&b.id));
|
meta.packages.sort_by(|a, b| a.id.cmp(&b.id));
|
||||||
for meta_pkg in &meta.packages {
|
for meta_pkg in &meta.packages {
|
||||||
let cargo_metadata::Package {
|
let cargo_metadata::Package {
|
||||||
id, edition, name, manifest_path, version, metadata, ..
|
id, edition, name, manifest_path, version, metadata, ..
|
||||||
} = meta_pkg;
|
} = meta_pkg;
|
||||||
let meta = from_value::<PackageMetadata>(metadata.clone()).unwrap_or_default();
|
let meta = from_value::<PackageMetadata>(metadata.clone()).unwrap_or_default();
|
||||||
let is_member = ws_members.contains(id);
|
|
||||||
let edition = edition.parse::<Edition>().unwrap_or_else(|err| {
|
let edition = edition.parse::<Edition>().unwrap_or_else(|err| {
|
||||||
tracing::error!("Failed to parse edition {}", err);
|
tracing::error!("Failed to parse edition {}", err);
|
||||||
Edition::CURRENT
|
Edition::CURRENT
|
||||||
});
|
});
|
||||||
|
// We treat packages without source as "local" packages. That includes all members of
|
||||||
|
// the current workspace, as well as any path dependency outside the workspace.
|
||||||
|
let is_member = meta_pkg.source.is_none();
|
||||||
|
|
||||||
let pkg = packages.alloc(PackageData {
|
let pkg = packages.alloc(PackageData {
|
||||||
id: id.repr.clone(),
|
id: id.repr.clone(),
|
||||||
|
|
Loading…
Reference in a new issue