You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
view: tidy the structure and types of the Rust view model #2082
This content was written by an AI agent and must be verified by a human developer. After human verification, this alert may be removed.
Found in the review of #2057, which adds the experimental view. Paths refer to #2059's head.
Summary
Structure and types of the Rust side of the view:
Project root. The CLI (view_root_dir), the language server and the Wasm engine each find the project root again, with different fallbacks. Keep the root the loader already knows in LoadedProject, and drop the root_dir parameter of project_view.
root_source_dir turns the typed PackageSourceDirectory into a PathBuf, and is set by an assignment after from_parts.
Module names.Scope::module_name in crates/graphcal-project/src/view_model/project.rs guesses a module's path by skipping as many segments as the source directory has components, then joins them with .. The loader or ModulePaths should record the module path of every file, the root included.
SourceFiles::name_of returns "" as a sentinel for an unknown file.
Node kind.ViewNodeKind::External mixes what a node is with where it comes from. Split it into kind and origin: Local | Imported | Included, with the model contract changes.
EvalResult.identities in graphcal-eval is a map kept in step with entries. Store the identity in each entry instead.
Wasm outcome.EvaluateViewOutcome::Unavailable { message } covers "prepared without the view", "projection failed" and "a value could not be displayed" with one string. view: fix the must-fix findings of the #2057 review #2059 made the prepared state an enum (PreparedView); the outcome should follow.
Activity
View model contract v1 (#2090 lane A) (#2106)