0005: Declarative extensions now; out-of-process code later
- Status: Proposed (format 1 implemented; runtime proposed only)
- Date: 2026-12-05
Context
Extensibility is a core requirement, but running third-party code inside the IDE risks crashes, slowdowns and security problems. A native plugin ABI in Rust is unstable across compiler versions.
Decision
- Manifest format 1 (implemented) is declarative: themes, language mappings to built-in grammars, regex decorations and commands with built-in actions. Strict validation, semver
enginecompatibility, qualified contribution ids, enable/disable, discovery only from bundled data and the user's extension directory. - Code-executing extensions (proposed) will run out of process, speaking a versioned JSON-RPC protocol, declaring permissions in the manifest, requiring user approval, and supervised like language servers (restart limits, timeouts, resource accounting).
- Native dynamic libraries loaded into the IDE process are rejected (unstable ABI, no fault isolation, full process privileges).
Alternatives considered
- WebAssembly in process (wasmtime or similar): good isolation and portability; the runtime adds tens of MB and an API surface to design. A strong candidate for the format-2 runtime; to be compared in the out-of-process RFC.
- Embedded scripting (Lua, JavaScript): easy to start, but shares the UI thread and process and needs its own sandboxing.
- In-process native plugins: rejected as above.
Consequences
- Today's extensions cannot crash or slow the IDE beyond bounded regex work, and they need no permissions.
- Richer extensions wait for the runtime; the manifest rejects unknown fields so code-oriented manifests fail loudly instead of loading partially.
- Process separation gives fault isolation, not a security sandbox; documentation must say so until OS sandboxing is added.
Validation
Tests register, select, invoke, disable and re-enable contributions and reject incompatible or invalid manifests. Two bundled extensions use the public format.