Skip to main content

Module workspace

Module workspace 

Source
Expand description

Workspace file discovery and @import closure construction (ADR-0091).

Each open editor buffer is analyzed as its own compilation root: the LSP parses it, walks for @import("...") calls, transitively loads every reachable file (open buffer first, on-disk fallback), and hands the closure to the frontend as a single CompilationUnit. Unrelated files in the workspace are never merged together — that’s what kept opening this very repo from producing thousands of fn main() duplicate-definition errors before ADR-0091’s per-root revision (2026-05-19).

Functions§

build_root_closure
Build a (root + transitively-@import-reachable) WorkspaceFile set for one compilation root.
enumerate_gruel_files
Enumerate every *.gruel file under root, respecting .gitignore and skipping .git/target.