Skip to content

Commit 2c32a54

Browse files
committed
save dev state
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent 8bbdb07 commit 2c32a54

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/bootstrap/src/utils/ra_project.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ struct Crate {
3737
proc_macro_dylib_path: Option<String>,
3838
is_workspace_member: bool,
3939
root_module: String,
40+
// This is only for proc-macro crates, we can skip serializing it.
41+
// #[serde(skip)]
42+
manifest_path: String,
4043
}
4144

4245
#[derive(Debug, Default, Serialize, PartialEq, PartialOrd, Ord, Eq)]
@@ -109,14 +112,13 @@ impl RustAnalyzerProject {
109112

110113
// Find and fill dependencies of crates.
111114
for package in packages {
112-
if package.dependencies.is_empty() {
113-
continue;
114-
}
115+
if let Some(index) =
116+
ra_project.crates.iter().position(|c| c.display_name == package.name)
117+
{
118+
// Needed for proc-macro crates.
119+
ra_project.crates[index].manifest_path = package.manifest_path;
115120

116-
for dependency in package.dependencies {
117-
if let Some(index) =
118-
ra_project.crates.iter().position(|c| c.display_name == package.name)
119-
{
121+
for dependency in package.dependencies {
120122
if let Some(dependency_index) =
121123
ra_project.crates.iter().position(|c| c.display_name == dependency.name)
122124
{

0 commit comments

Comments
 (0)