The editor knows the language

Errors, types on hover, completion and signature help from the language's own server, and a proof assistant's goals as you edit.

Framework decisions behind it: D22 to D31.

The language's own server runs in the page, as a worker. It tells the editor about errors, types and completions as you type. Nothing starts until you click into an editor, and none of it needs a server of yours.

Errors as you type

Fix the red line: clamp takes three arguments, and this call gives four.

function clamp(x: number, lo: number, hi: number): number { return Math.min(hi, Math.max(lo, x)); } const wide: number = clamp(15, 0, 10, 5);

Types on hover

Hover clamp in the last line to see its type.

function clamp(x: number, lo: number, hi: number): number { return Math.min(hi, Math.max(lo, x)); } const inside = clamp(7, 0, 10);

Completion

Put the cursor after Math., delete the dot and type it again to see the completions.

function clamp(x: number, lo: number, hi: number): number { return Math.min(hi, Math.max(lo, x)); } const biggest = Math.

Signature help

Type 7, after the bracket: the parameter you are filling in is marked.

function clamp(x: number, lo: number, hi: number): number { return Math.min(hi, Math.max(lo, x)); } const low = clamp(

A proof assistant's goals

Rocq runs in the page. Put the cursor after split. and open the Goals tab: it lists what is left to prove there. Edit the proof, and the goals follow.

Lemma and_swap : forall A B : Prop, A /\ B -> B /\ A. Proof. intros A B [a b]. split. - exact b. - exact a. Qed.