v0.145.4Internal beta docs

Beta documentation · eXLib v0.145.4. Public release is pending.

Real-time Diagnostics

eXLib validates your expression after you pause typing and marks problems inline, using rules tuned to After Effects' expression engine.

How validation runs

Typing schedules a validation pass about 600 ms after the latest edit, so a burst of keystrokes becomes one worker request instead of one request per key. If validation hits an internal problem, you get an "internal error" diagnostic rather than a falsely clean file — everything else keeps working.

Parsing tolerates incomplete code, so it doesn't collapse into a cascade of parse errors while you're still typing.

Reading a severity

eXLib uses one consistent visual language across roughly 40 rule codes:

Severity Color Meaning
Error Red eXLib found code expected to be rejected or throw in AE. Always shown, never hideable.
Warning Yellow Works, but risky — likely a bug or a coercion/compatibility hazard.
Info Blue/gray Advisory — style, unused code, best-practice nudges.
Hint Faint Lowest-level suggestion.

The rule is simple: red is eXLib's fail verdict; yellow means "runs but risky"; blue/gray is advisory. When release evidence proves a rule disagrees with AE, the rule or its documentation is corrected rather than treating the analyzer as the authority.

What eXLib catches

eXLib's diagnostics are built from live-AE evidence and the modern expression engine's behavior, not a stock browser or TypeScript checker.

AE-specific traps

  • ASI hazards — the After Effects-specific missing-semicolon trap where the next line starting with (, [, a backtick, or / gets silently combined into your statement. eXLib names exactly what AE will do wrong — for example, "will combine this line with the next, treating it as array access: myVar[0]."
  • Scalar-property indexing — flags rotation[0] or opacity[0], since scalar properties are plain numbers, not arrays.
  • The .property('Name') antipattern — not valid AE syntax; eXLib suggests the correct forms (thisLayer.Position, thisLayer("Position"), or thisLayer.transform.Position).
  • Invalid chains — calling .valueAtTime after an already-broken property lookup.
i

These screenshots were captured in an earlier beta. Toolbar and Library layouts have since changed; the written instructions on this page describe v0.145.4. See A Tour of the Panel for the current controls.

Two-line expression showing the ASI-hazard error underline and its hover explanation
The After Effects ASI trap: eXLib names the silent combination AE will perform, not just "missing semicolon."

Type & object-model checks

  • Undefined variables with typo suggestions — "possiton is not defined. Did you mean position?"
  • Property/method validation against the AE object model (Layer, Comp, Property, Camera, Text, Mask, Effect, and primitives), with "Did you mean X?" for unknown members, non-callable property calls, and access on null/undefined.
  • Vector/scalar math — rejects operations AE throws on (like thisLayer.position * [100,200]), flags dimension mismatches (2D + 3D), and warns on runtime-dependent shapes.
  • Built-in argument counts and types — "linear requires at least 5 arguments; 3 provided."

ES2015+ semantics AE actually enforces

  • Temporal Dead Zone (TDZ) — using a let/const before its declaration line.
  • const reassignment — reassigning a constant.
  • Reserved keywords as identifiers — var class = 5;.

JavaScript gotchas that produce silent garbage

  • Implicit coercion — "5" + 10 becoming the string "510", with the exact wrong result shown and a Number() fix suggested.
  • Array/object == comparison — always false (compares by reference), with a JSON.stringify() fix.
  • Lossy conversions — parseInt()/Math.floor() truncating decimals.

Engine-accurate unsupported/advisory handling

Construct Severity Why
import/export (static) Error Genuinely rejected by AE.
import('y') (dynamic) Warning Parses and runs, but is per-frame useless — there's no event loop.
async/await (not top-level) Warning Same reason as dynamic import.
Bare top-level await Error A genuine syntax error.
with / eval Info Run fine in AE's sloppy-mode engine — best-practice advisory only.
Sandbox-limited globals (Promise, typed arrays, Proxy/Reflect, SharedArrayBuffer/Atomics) One-time advisory "Exists but limited," never a false "undefined."
Four statements — static import, dynamic import, with block, and top-level await — each underlined with a different severity
Four related constructs, four different verdicts.
i

After Effects expressions are implicit-return (REPL-style), and AE only rejects a valueless result at apply time, with its own error. So eXLib does not flash a premature error while you're still composing a value line that momentarily ends in a declaration — you'll see the real problem only when it matters, when you apply.

Typing grace — no red flashes mid-keystroke

A small set of "still being typed" diagnostics — missing else, missing initializer, and missing semicolon — are suppressed only on the exact line you're editing, for about 1.5 seconds or until your caret leaves that line. So typing if (x) or const x = doesn't flash red before you've finished. A known result-type mismatch is never hidden: it must remain visible when you are deciding whether to Apply the expression to that property.

Genuinely broken references — an undefined variable, a const reassignment — are never hidden by typing grace. They appear as soon as the debounced validation pass completes.

One squiggle, complete hovers

When several diagnostics overlap the same span, eXLib renders only the single most-severe squiggle — no pile-up of stacked red and yellow underlines on one token. Nothing is lost: hovering that token surfaces every diagnostic that applies there, each with its own severity badge, sorted Error → Warning → Info → Hint.

Style-only nags — semicolon style, unused variable, if-without-else — are also suppressed on any line that already has a real error, so a broken line shows just the bug, not a stack of secondary complaints.

i

On pathological input, the problem list is capped at 100, with an "N additional diagnostics hidden" notice.

The status bar (bottom-left) shows live Error / Warning / Info / Hint counts, or a green "No Problems" state. Click any severity to jump to its first instance and open the marker overlay.

F8 goes to the next problem; Alt+F8 goes to the previous. A floating overlay shows the current diagnostic's full message and position, with prev/next/close controls, looping at both ends. Escape or clicking outside closes it.

The F8 problem-navigation overlay open beside the status bar's severity buckets
F8 walks the problem list; the status-bar buckets are clickable shortcuts into it.
i

{{token}} highlights are not diagnostics: they never appear in the status-bar problem count, the overview ruler, or the F8 walk. Those show only real errors and warnings.