Render IR fragment
render_ir_fragmentRender a top-level definition's typed intermediate representation as JSON to reveal desugared bodies, resolved node types, and compiler-generated functions.
Instructions
Render the typed intermediate representation (IR) of one top-level definition as JSON. Use it when the exact lowered structure matters: desugared bodies, the resolved type on every node, a tool's generated function. The IR is verbose and follows the compiler's declaration serialization, so for a human-oriented view prefer get_context_for_symbol or lookup_definition. Returns module, name, and ir (the serialized declaration). An unknown name is not_found with the available names in error.data.available; a type alias is no_ir (aliases are expanded before lowering) with its expansion in error.data.expansion. Read-only: compiles the file's directory in memory (cached until a sibling changes) and writes or executes nothing. Failures are isError results with a stable error.code: file_not_found, read_error, invalid_params, and, for every tool but check_file, parse_error or check_error carrying coded diagnostics in error.data.diagnostics (the shape check_file returns).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Path to a .hird source file, absolute or relative to the server's working directory. Every .hird file in its directory is compiled with it as one program, so imported names resolve; answers may name a sibling file. | |
| name | Yes | The definition's name, as the file's source would write it: a local definition, a member imported with `use Mod.{name}`, or `Qualifier.name` through `use Mod`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ir | Yes | The declaration, as the compiler serializes its IR. | |
| file | Yes | ||
| name | Yes | ||
| module | Yes |