Inline Values
See variables, function returns, and loop iterations update inline as you type.
Inline values are ParrotJSβs flagship feature: runtime values appear right next to the expression that produced them, updating continuously as you type.
PRO feature. Full inline runtime values are a PRO feature. On the free tier, ParrotJS shows live comments and console output only. See Free vs PRO.
What Gets Captured
ParrotJS instruments your code and captures a value for:
- Variable assignments β
const x = compute();shows the assigned value. - Expression statements β standalone expressions show their result.
- Function returns β return values display at the call site.
- Loop iterations β each iteration of a loop shows the current value, with an iteration counter.
- Object and array literals β nested structures render inline (to a configurable depth).
How It Looks
// PRO shows these inline, as you type:
const add = (a, b) => a + b;
const result = add(3, 7); // β 10
const user = { name: 'Ada', age: 36 }; // β {name: 'Ada', age: 36}
Values update automatically as you edit β no save, no re-run, no terminal.
Controlling the Output
| Setting | Default | Effect |
|---|---|---|
parrotjs.showInlineValues |
true |
Master switch for inline value display |
parrotjs.maxInlineLength |
80 |
Maximum characters before an inline value is truncated with β¦ |
parrotjs.maxObjectDepth |
3 |
Maximum object nesting shown inline; deeper levels render as {β¦} |
parrotjs.autoLog |
true |
Automatically capture all meaningful expressions (see Auto-Log) |
parrotjs.executionDelay |
300 |
Debounce before re-executing after you stop typing |
Sticky Values
Values persist across edits as dimmed italic annotations, so you donβt lose sight of the last known value while youβre mid-edit. When code re-executes:
- Updated values refresh to the current styling.
- Errors automatically clear on a successful re-execution.
- Run ParrotJS: Clear Sticky Values to reset all persistent values.
Selection Evaluation
Select any expression in your code and ParrotJS evaluates it against the current execution context, showing the result as a temporary inline decoration at the end of the line. Handy for probing sub-expressions without adding markers.
Related
- Live Comments β the free alternative for targeted values.
- Value Explorer β deep-inspect captured objects.
- Configuration β settings reference.