Semantic Editing

The editor does not modify a source file. It projects semantic structure plus the exact edit and action capabilities available at that revision, then translates normal typing into those capabilities.

A restricted region may temporarily contain incomplete text and compiler errors. The draft is persisted, but the session candidate and preview remain at the last successful compilation. Cmd+Enter compiles the complete intention atomically; committing later advances the branch head.

Several restricted regions may remain open. Only one is focused at a time. Moving elsewhere does not finish or cancel the previous intention; another compatible edit can start and both drafts stay visible. Exact-target conflicts are rejected, while independent edits and separate list positions coexist. Compiling one insertion rebases the remaining semantic list anchors.

Valid open replacements compose as one temporary semantic draft. A reference rebind followed by a declaration rename therefore keeps the same target identity, and compiling the rename rebases the still-open reference spelling.

Enter, Vim o/O, commas in structural lists, declaration edits, reference edits, and paired-tag renames all enter this same model. Enter splits HTML text at the caret, does nothing inside an unsplittable scalar name, and opens the containing list only from a semantic line boundary. Because references use identities, renaming a let, local var, parameter, field, or function updates every projected use atomically, while editing one reference means rebind this use.

Line insertion follows the visible structure: o enters a composite or adds below a leaf, while O adds a sibling above the visible semantic node. HTML-result functions expose an ordinary statement list before the final HTML value. Types and expressions also contain semantic name nodes. Names not declared locally are kept as explicit external references rather than rejected or stored as opaque text.

In Vim Normal mode, Escape cancels the newest empty hole even when Vim has placed its caret beside the zero-width restricted region.

Typing outside an advertised edit site changes nothing and shows a short neutral hint. Incomplete text inside an active region is allowed and diagnosed live. It becomes semantic state only after Cmd+Enter parses and validates the complete intention.

Cmd+Enter may be pressed immediately after typing: compilation waits for that exact region to be acknowledged. Completing one intention preserves the cursor and never activates an unrelated open intention.

Optional syntax uses zero-width sites. Typing at the site can add an export modifier, return type, binding type, prior value, return value, or HTML attribute value. Selecting the complete optional value and deleting it clears that facet structurally and returns the insertion site.