diff --git a/crates/treehouse/src/tree.rs b/crates/treehouse/src/tree.rs index 00a5bb7..78a0225 100644 --- a/crates/treehouse/src/tree.rs +++ b/crates/treehouse/src/tree.rs @@ -97,7 +97,7 @@ impl SemaRoots { let successfully_parsed = successfully_parsed; if successfully_parsed { - let attribute_warning_span = roots + let _attribute_warning_span = roots .attributes .as_ref() .map(|attributes| attributes.percent.clone()) @@ -109,28 +109,6 @@ impl SemaRoots { _ => panic!("parse_attributes called for a non-.tree file"), } } - - if attributes.id.is_empty() { - attributes.id = format!("treehouse-missingno-{}", treehouse.next_missingno()); - diagnostics.push(Diagnostic { - severity: Severity::Warning, - code: Some("attr".into()), - message: "page does not have an `id` attribute".into(), - labels: vec![Label { - style: LabelStyle::Primary, - file_id, - range: attribute_warning_span.clone(), - message: String::new(), - }], - notes: vec![ - format!( - "note: a generated id `{}` will be used, but this id is unstable and will not persist across generations", - attributes.id - ), - format!("help: run `treehouse fix {}` to add missing ids to pages", treehouse.path(file_id)), - ], - }); - } } if let Some(thumbnail) = &attributes.thumbnail { diff --git a/crates/treehouse/src/tree/attributes.rs b/crates/treehouse/src/tree/attributes.rs index 6a5a654..3829d5f 100644 --- a/crates/treehouse/src/tree/attributes.rs +++ b/crates/treehouse/src/tree/attributes.rs @@ -7,10 +7,6 @@ use crate::{state::FileId, vfs::VPathBuf}; /// Top-level `%%` root attributes. #[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)] pub struct RootAttributes { - /// Permanent ID of this page. - #[serde(default)] - pub id: String, - /// Template to use for generating the page. /// Defaults to `_tree.hbs`. #[serde(default)] diff --git a/crates/treehouse/tests/it/vfs/mount_points.rs b/crates/treehouse/tests/it/vfs/mount_points.rs index f08b956..c030784 100644 --- a/crates/treehouse/tests/it/vfs/mount_points.rs +++ b/crates/treehouse/tests/it/vfs/mount_points.rs @@ -1,6 +1,4 @@ -use treehouse::vfs::{ - entries, query, BufferedFile, Content, Dir, MemDir, ToDynDir, VPath, VPathBuf, -}; +use treehouse::vfs::{entries, query, BufferedFile, Content, MemDir, ToDynDir, VPath, VPathBuf}; const HEWWO: &[u8] = b"hewwo :3"; const FWOOFEE: &[u8] = b"fwoofee -w-";