Show workspace info in the status bar

This commit is contained in:
Lukas Wirth 2024-04-26 11:06:52 +02:00
parent 56bee2ddaf
commit 18ca22a98e
15 changed files with 168 additions and 81 deletions

View file

@ -199,7 +199,8 @@ impl ProjectWorkspace {
let data = serde_json::from_str(&file)
.with_context(|| format!("Failed to deserialize json file {project_json}"))?;
let project_location = project_json.parent().to_path_buf();
let project_json: ProjectJson = ProjectJson::new(&project_location, data);
let project_json: ProjectJson =
ProjectJson::new(Some(project_json.clone()), &project_location, data);
ProjectWorkspace::load_inline(
project_json,
config.target.as_deref(),
@ -555,7 +556,7 @@ impl ProjectWorkspace {
pub fn manifest_or_root(&self) -> &AbsPath {
match &self.kind {
ProjectWorkspaceKind::Cargo { cargo, .. } => cargo.manifest_path(),
ProjectWorkspaceKind::Json(project) => project.path(),
ProjectWorkspaceKind::Json(project) => project.manifest_or_root(),
ProjectWorkspaceKind::DetachedFile { file, .. } => file,
}
}