Rewrite Project, remove SourceProject (#274)

* Rewrite project file to have relative paths and drop SourceProject

* Redo project error types

* Tidy up and document Project type

* Strip out init command
This commit is contained in:
Lucien Greathouse
2019-12-12 14:45:15 -08:00
committed by GitHub
parent 47c7f63d75
commit 1f7f2b22e7
16 changed files with 233 additions and 539 deletions

View File

@@ -110,16 +110,24 @@ impl Default for InstanceContext {
#[derive(Clone, PartialEq, Serialize, Deserialize)]
pub enum InstigatingSource {
Path(#[serde(serialize_with = "path_serializer::serialize_absolute")] PathBuf),
ProjectNode(String, ProjectNode),
ProjectNode(
#[serde(serialize_with = "path_serializer::serialize_absolute")] PathBuf,
String,
ProjectNode,
),
}
impl fmt::Debug for InstigatingSource {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
InstigatingSource::Path(path) => write!(formatter, "Path({})", path.display()),
InstigatingSource::ProjectNode(name, node) => {
write!(formatter, "ProjectNode({}: {:?}", name, node)
}
InstigatingSource::ProjectNode(path, name, node) => write!(
formatter,
"ProjectNode({}: {:?}) from path {}",
name,
node,
path.display()
),
}
}
}