module

Icr

Constants

VERSION = "1.3.0"

Class methods

interpreter_bin

Where the live backend's compiler comes from, in order:

  1. ICR_CRYSTAL env var (explicit override)
  2. CRYSTAL_INTERPRETER_PATH env var (checked from Crystal code at startup via ENV — no Rakefile needed)
  3. ~/.local/share/icr/crystal/bin/crystal (scripts/build-interpreter.sh)
  4. crystal from PATH (usually lacks interpreter support; the CLI then falls back to replay mode)
Source
open_session(cwd : String | Nil = nil) : LiveSession | ReplaySession

Library-friendly entry point: open the best available session — a LiveSession when interpreter_bin resolved to an interpreter- capable crystal (env vars → ~/.local/share/icr → PATH), a ReplaySession otherwise. This is the same logic the CLI uses, so shard consumers always get the live interpreter by default when one is present. Env vars are read at call time: host apps can set ENV["CRYSTAL_INTERPRETER_PATH"] (or ICR_CRYSTAL) in their own code before calling this.

Source

Macros

enable_autocomplete!

Opt into the baked completion table without requiring anything. Expands to a marker def carrying the annotation; macro finished below looks for those markers. (Duplicate defs are legal in Crystal; repeated calls simply re-mark, and the harvest dedupes.)

Source

Nested types