Compile-time bail! that attaches an ErrorContext carrying the
expression’s Origin and SourcePosition. The LSP recovers both by
downcasting ErrorContext out of the anyhow chain — no message-string
scraping. Use this instead of bail!("at {} …", spec.pos) in compile
paths where the spec Expr is in scope.
A registry of abstract type UUIDs used by graphix and graphix libraries,
along with a string tag describing what the type is. We must do this because
you can’t register different type ids with the same uuid in netidx’s
abstract type system, and because abstract types often need to be
parameterized by the Rt and UserEvent they will have different a different
type id for each monomorphization, and thus they must have a different uuid.
Event represents all the things that happened simultaneously in a
given execution cycle. Event may contain only one update for each
variable and netidx subscription in a given cycle, if more updates
happen simultaneously they must be queued and deferred to later
cycles.
Per-module snapshot of the internal env (the impl’s view, where
implementation bindings shadow sig proxies). The CheckResult’s
top-level env is the external view across the project; this
per-module entry lets IDE queries on names inside a module reach
the impl bind metadata. Only populated when env.lsp_mode is set.
A textual occurrence of a module reference (either use foo; or
mod foo;). For the mod foo; case def_ori points at the file
the module’s body was loaded from — that’s the natural target for
go-to-definition on a module name.
A textual occurrence of a name at a specific source position that
the compiler resolved to a particular BindId. Populated as a side
effect of compilation so IDE tooling can answer
textDocument/references and textDocument/definition without
re-implementing name resolution.
One entry in the per-compile scope map: the compiler descended
into an Expr at this (pos, ori) while in this scope. IDE
tooling answers cursor → scope by finding the entry with the
greatest pos ≤ the cursor in the same file.
Maps a val foo: T declaration in a .gxi interface to its
let foo = … implementation site in the paired .gx. Populated by
check_sig whenever it matches a sig proxy bind to its impl bind.
Used by IDE tooling to (a) goto-def from a sig val site to the impl,
and (b) union find-references results across both BindIds.
Only populated when env.lsp_mode is set.
A textual occurrence of a type reference (e.g. Foo in let x: Foo).
Captured by the compiler when a Type::Ref carrying parse-time
position info gets dereferenced. def_pos/def_ori point at the
type Foo = … declaration site so go-to-def on a type name lands
on the typedef.
Pools backing the IDE side-channel collections. GPooled so the
buffers can return to the same pool after crossing the
runtime-task → LSP-thread boundary as part of CheckResult. Sized
generously since the LSP recompiles on every keystroke and these
can grow into the tens of thousands of entries on large modules.
Apply is a kind of node that represents a function application. It
does not hold ownership of it’s arguments, instead those are held
by a CallSite node. This allows us to change the function called
at runtime without recompiling the arguments.
Trait implemented by graphix built-in functions implemented in rust. This
trait isn’t meant to be implemented manually, use derive(BuiltIn) from the
graphix-derive crate
Update represents a regular graph node, as opposed to a function
application represented by Apply. Regular graph nodes are used for
every built in node except for builtin functions.