Register virtual workspace Cargo.toml files in the VFS

This commit is contained in:
Lukas Wirth 2024-06-09 12:54:50 +02:00
parent 7f1f85ac16
commit d4dc3ca83b
15 changed files with 77 additions and 37 deletions

View file

@ -167,6 +167,11 @@ impl ProjectJson {
&self.project_root
}
/// Returns the path to the project's manifest file, if it exists.
pub fn manifest(&self) -> Option<&ManifestPath> {
self.manifest.as_ref()
}
/// Returns the path to the project's manifest or root folder, if no manifest exists.
pub fn manifest_or_root(&self) -> &AbsPath {
self.manifest.as_ref().map_or(&self.project_root, |manifest| manifest.as_ref())