//! Workspace root discovery and canonical workspace-relative path normalization shared by
//! `WatchCache`, `hot_diff`, and `view_diff`.
//!
//! Single-sourced directly from [`nativeview_view_syntax::resolve_workspace_rel_file`] so
//! `AnchorKey` hashes match `view-macros` 1-to-1 across crates, standalone examples, and OSes.
use Path;
/// Normalizes `path` to a workspace-relative (or standalone crate-relative) POSIX path matching
/// `file!()` / `Span::call_site().file()` so `AnchorKey`s hash
/// identically in `nv dev` (absolute paths from `notify`) and the compiled app.
/// Normalizes `path` relative to `explicit_root` (when `path` lies inside it) or falls back to
/// Cargo manifest `[workspace]` / crate-root discovery.