diff --git a/src/bootstrap/src/utils/ra_project.rs b/src/bootstrap/src/utils/ra_project.rs index 53342ba72017b..2f985036606d7 100644 --- a/src/bootstrap/src/utils/ra_project.rs +++ b/src/bootstrap/src/utils/ra_project.rs @@ -37,6 +37,9 @@ struct Crate { proc_macro_dylib_path: Option, is_workspace_member: bool, root_module: String, + // This is only for proc-macro crates, we can skip serializing it. + // #[serde(skip)] + manifest_path: String, } #[derive(Debug, Default, Serialize, PartialEq, PartialOrd, Ord, Eq)] @@ -109,14 +112,13 @@ impl RustAnalyzerProject { // Find and fill dependencies of crates. for package in packages { - if package.dependencies.is_empty() { - continue; - } + if let Some(index) = + ra_project.crates.iter().position(|c| c.display_name == package.name) + { + // Needed for proc-macro crates. + ra_project.crates[index].manifest_path = package.manifest_path; - for dependency in package.dependencies { - if let Some(index) = - ra_project.crates.iter().position(|c| c.display_name == package.name) - { + for dependency in package.dependencies { if let Some(dependency_index) = ra_project.crates.iter().position(|c| c.display_name == dependency.name) {