Expand description
Content-ownership track (#1086) slice 3: the cross-crate replacement for
diagnose_project(&root, &HashMap::new()) and bare
CompileOptions::single/::split’s reliance on bynk-emit’s disk
fallback (design/tracks/content-ownership.md §3.3, §4).
Every helper here walks a project exactly the way production code already
does — bynk_ide::discover_files for diagnose_project*-style callers,
the same bynk_emit::project::Roots a CompileOptions will itself
compile for compile_options_* — and reads every file into a complete
sources map, instead of reimplementing the walk. There is no second
resolution to drift from the first: a test built on these helpers cannot
silently miss a file because this crate’s notion of “the project’s files”
diverged from the compiler’s own.
Dev-only: invisible to fs_below_driver’s probe
(design/greenfield-status.md), which is scoped to the crates below the
driver (bynk-emit, bynk-ide, bynk-fmt) — not to dev-only crates like
this one, which is why this file’s own real std::fs reads (read_all,
the bynk.toml read below) never register, not because the probe walks
only production code.
Functions§
- compile_
options_ single CompileOptions::single(root), with every source pre-read — the direct replacement for its reliance onbynk-emit’s disk fallback.- compile_
options_ split CompileOptions::split(project_root, paths), with every source pre-read. Discovers exactly the filesCompileOptions::splititself would compile — built from the samepathsthis call also hands tosplit, not re-derived frombynk.tomlthrough a second read, so the two can never disagree.- read_
project_ sources - A complete
(path, content)map forroots, resolved and enumerated the same waybynk_ide::diagnose_project_with’s own callers already do — the direct replacement fordiagnose_project(&root, &HashMap::new())’s reliance onbynk-emit’s disk fallback filling in what the (empty) overlay doesn’t cover.