Add path of workspace root folders to status output
This commit is contained in:
parent
9549753352
commit
677c0eeccb
@ -450,6 +450,14 @@ impl ProjectWorkspace {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn workspace_definition_path(&self) -> Option<&AbsPath> {
|
||||
match self {
|
||||
ProjectWorkspace::Cargo { cargo, .. } => Some(cargo.workspace_root()),
|
||||
ProjectWorkspace::Json { project, .. } => Some(project.path()),
|
||||
ProjectWorkspace::DetachedFiles { .. } => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn find_sysroot_proc_macro_srv(&self) -> Option<AbsPathBuf> {
|
||||
match self {
|
||||
ProjectWorkspace::Cargo { sysroot: Some(sysroot), .. }
|
||||
|
@ -29,7 +29,7 @@ use project_model::{ManifestPath, ProjectWorkspace, TargetKind};
|
||||
use serde_json::json;
|
||||
use stdx::{format_to, never};
|
||||
use syntax::{algo, ast, AstNode, TextRange, TextSize};
|
||||
use vfs::AbsPathBuf;
|
||||
use vfs::{AbsPath, AbsPathBuf};
|
||||
|
||||
use crate::{
|
||||
cargo_target_spec::CargoTargetSpec,
|
||||
@ -84,6 +84,15 @@ pub(crate) fn handle_analyzer_status(
|
||||
snap.workspaces.len(),
|
||||
if snap.workspaces.len() == 1 { "" } else { "s" }
|
||||
);
|
||||
|
||||
format_to!(
|
||||
buf,
|
||||
"Workspace root folders: {:?}",
|
||||
snap.workspaces
|
||||
.iter()
|
||||
.flat_map(|ws| ws.workspace_definition_path())
|
||||
.collect::<Vec<&AbsPath>>()
|
||||
);
|
||||
}
|
||||
buf.push_str("\nAnalysis:\n");
|
||||
buf.push_str(
|
||||
|
Loading…
x
Reference in New Issue
Block a user