Skip to content

Commit 7562b17

Browse files
committed
Auto merge of #18289 - darichey:fix-relative-buildfiles, r=lnicola
Fix panic when json project has relative buildfile paths The `build_file` path may be relative to the workspace root.
2 parents ee7c8b9 + 0865296 commit 7562b17

File tree

1 file changed

+1
-1
lines changed
  • src/tools/rust-analyzer/crates/project-model/src

1 file changed

+1
-1
lines changed

src/tools/rust-analyzer/crates/project-model/src/workspace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ impl ProjectWorkspace {
553553
ProjectWorkspaceKind::Json(project) => project
554554
.crates()
555555
.filter_map(|(_, krate)| krate.build.as_ref().map(|build| build.build_file.clone()))
556-
.map(AbsPathBuf::assert)
556+
.map(|build_file| self.workspace_root().join(build_file))
557557
.collect(),
558558
_ => vec![],
559559
}

0 commit comments

Comments
 (0)