## Source

- "Automatic code formatting for JS"
- "Automatic formatter"
- "Code - Type hints, LSP, jump to definition"

## Current state

The Code panel uses Monaco with the TypeScript worker. It imports formatting, hover, suggestions, signature help and go-to-definition, and loads the hardware runtime declarations through `runtimeDeclarations()`. There is no automatic formatter for project source, and no e2e coverage of editor intelligence.

## Acceptance

- [ ] Verify and document the TypeScript behaviour a user gets today: hover, completion, signature help, go-to-definition and diagnostics against both the project source and the runtime declarations.
- [x] Decision: format **on type**, not only on save. Choose the formatter by measured bundle cost and embedding complexity, not familiarity.
- [ ] Benchmark the TypeScript worker formatter against a small embedded formatter (for example a prebuilt oxfmt/Prettier distribution) and pick the cheapest option that meets the formatting bar.
- [ ] Add format-on-type with debounce, plus a format-document command and shortcut. Provide an opt-out in settings.
- [ ] Formatting is deterministic, preserves the cursor/selection, and does not echo a remote update back into the collaboration loop.
- [ ] The formatter and editor-intelligence actions are reachable from the command palette and appear in shortcut settings.
- [ ] Add e2e coverage: format a snippet and assert the document changes; go to definition on a runtime API and assert the jump.
- [ ] Any language service remains local to the browser; no network model is introduced.


<sub>Generated on _MrBeast_ using _opencode/deepseek-v4.1-flash_ in _ses_e8326e581ffeJviTmSkomwnKES_</sub>


