0015: Versioned language provider contracts
- Status: Proposed (implemented in Phase 2, task 007)
- Date: 2026-12-05
Context
Rust was built into the core, with its language server wired to a language id, and the desktop guessed project roots from a hard-coded marker list. Adding C#, Python, tasks, debugging and AI context that way would scatter Cargo, MSBuild and Python assumptions through the core and the UI. Extensions are declarative (ADR 0005) and must stay that way.
Decision
- A language is a data registration plus named providers. A provider is trusted Rust code compiled into the IDE with a qualified id (
axiom.rust/project). It answers one role: project, toolchain, semantic, tasks, debug, prediction or AI context. - Manifest format 2 lets a language contribution name providers by id, declare the provider contract version and depend on other extensions (
requires). It also adds typed, bounded settings. Format 1 manifests load unchanged. A manifest can name only registered providers that offer the role. It can never name a program or code. - The contracts in
ide_languages::providerare UI-free and synchronous. They take a boundedWorkspaceSnapshotand aCancelToken, return typed values (ProjectDescriptor,ToolchainStatus,SemanticConfig,Invocation,LaunchPlan) or typed errors, and report an absent capability asUnsupported. - Rust, C# and Python are bundled extensions, each of which can be disabled on its own. Plain text, TypeScript and JavaScript stay built in. Disabling a language moves its open documents to their new language, stops services no active language uses, unregisters its settings and re-runs project discovery. Re-enabling needs no restart.
- Project discovery is lazy (on request), runs on a background worker, reads names and small manifests only, and isolates each provider's errors and panics.
- Profiles are defaults, not gates. The Rust profile now allows every language server.
Alternatives considered
- Executable paths in manifests: lets a downloaded manifest choose what runs; rejected.
- One trait object per language: couples unrelated roles and forces every language to implement every role.
- Keep Rust built in: makes it impossible to turn off and keeps a special case in the core.
Consequences
- New languages add provider code and a manifest; the core and desktop stay language-agnostic.
- Toolchain versions, task lists, debug launch plans, prediction and AI context have contracts but no bundled implementations yet. Tasks 011 to 019 add them. Until then each reports
Unsupported. - Token-class overrides for grammars are not part of format 2; built-in grammars keep their classes.
Validation
Manifest migration and rejection tests, dependency activation tests, provider resolution, snapshot bounds, mixed Rust/C#/Python discovery, failure isolation and enable/disable tests with fake providers. See Phase 2 validation.