mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Show workspace info in the status bar
This commit is contained in:
parent
56bee2ddaf
commit
18ca22a98e
15 changed files with 168 additions and 81 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue