Read rust-analyzer.toml files on startup

This commit is contained in:
Ali Bektas 2024-07-22 02:42:39 +02:00
parent 4afe0d5393
commit e0db833082
3 changed files with 40 additions and 8 deletions

View file

@ -523,6 +523,14 @@ impl ProjectWorkspace {
}
}
pub fn workspace_root(&self) -> &AbsPath {
match &self.kind {
ProjectWorkspaceKind::Cargo { cargo, .. } => cargo.workspace_root(),
ProjectWorkspaceKind::Json(project) => project.project_root(),
ProjectWorkspaceKind::DetachedFile { file, .. } => file.parent(),
}
}
pub fn manifest(&self) -> Option<&ManifestPath> {
match &self.kind {
ProjectWorkspaceKind::Cargo { cargo, .. } => Some(cargo.manifest_path()),