Skip to main content

Module expr_types

Module expr_types 

Expand description

v0.30.2 (ADR 0063): the expression-type sink.

The checker computes expr_types: HashMap<Span, Ty> per file as it types each expression, but that map rides inside the Ok(TypedCommons) payload check_record drops on error, and the LSP Analyse path discards it entirely. This sink carries it out to the analysis so completion can ask “what is the type of the expression at this offset?” (the receiver before a .), mirroring HintSink.

Capture is on the Ok path — a file’s types are recorded only when it checks clean (check_record returns Ok), so a mid-edit file with errors yields nothing for that file (the slice-3 “clean-file ceiling”, ADR 0063). Unlike hints, test/integration files are not muted (completion runs in them); only synthetic toolchain-injected files are.

Structs§

ExprTypeSink
Records per-file expression types. A fresh sink records nothing until enter_file attributes it.

Functions§

type_at_offset
The type of the innermost expression whose span contains offset, if any — the receiver-typing query for .-member completion.

Type Aliases§

FileExprTypes
Project-relative source path → that file’s (expr span, type) entries, ordered by span (innermost-last within a start, so a containment search can prefer the tightest match).