Skip to main content

Module analysis

Module analysis 

Source
Expand description

Compile analysis worker (ADR-0091).

The LSP runs one frontend compile per open root: the root is one open editor buffer, and its compilation unit is the root plus every file transitively reachable through @import("...") (open buffers preferred over disk). Unrelated workspace files are never merged together — that avoids the cascade of duplicate-fn main() diagnostics that the old whole-workspace-as-one-unit model produced the moment a workspace held more than one program.

Structs§

AnalysisResult
Result of one compile pass.
Snapshot
Successful compile snapshot (sema completed even if errors were reported).
WorkspaceFile
One source file the worker can see (either an open editor buffer or a file on disk).

Functions§

analyze
Compile the given workspace files via the frontend and return diagnostics + an optional successful snapshot.
analyze_root
Analyze a single root file plus its transitively-@import-reachable closure. Builds the closure (open-buffer text wins over disk), runs the frontend, and returns per-file diagnostics with an optional Snapshot when sema completed.