Open-Source Wikis

/

Zed

/

Systems

/

Extensions

zed-industries/zed

Extensions

Active contributors: kubkon, maxdeviant

Purpose

Zed supports WASM-based extensions. An extension can ship languages, themes, snippets, slash commands, MCP-style context servers, and debug adapters. The runtime sandboxes extensions in WASM and exposes a stable host API.

Crates

Crate Role
crates/extension Core extension types and runtime model
crates/extension_host The host that loads and runs extensions
crates/extension_api Public Rust API for extension authors (compiles to WASM)
crates/extensions_ui In-app UI for browsing, installing, configuring extensions
crates/extension_cli CLI for building / packaging extensions (binary)
extensions/ (top-level) First-party bundled extensions (html, glsl, proto, test-extension)

Key abstractions

Type Crate Description
Extension extension A loaded extension instance
ExtensionHost extension_host Manages installed extensions + WASM runtime
ExtensionHostProxy extension Cross-crate handle to the host (used by zed::main)
ExtensionManifest extension Parsed extension.toml
ContextServer crates/context_server MCP-style external tool server contributed by an extension

How it works

graph TD
    user[User] -->|install| EUI[extensions_ui]
    EUI --> Reg[(zed.dev registry)]
    Reg --> EUI
    EUI -->|hand off| EH[ExtensionHost]
    EH --> WASM[WASM module]
    WASM -->|calls| API[extension_api]
    API -.->|host calls| EH
    EH --> Lang[LanguageRegistry]
    EH --> Theme[ThemeRegistry]
    EH --> Snip[SnippetProvider]
    EH --> Cmd[Slash commands]
    EH --> Ctx[ContextServer registry]

Extension lifecycle

  1. extensions_ui shows the registry catalog (served from zed.dev).
  2. Installing fetches the prebuilt extension archive (built by extension_cli) and writes it under the user's extensions dir.
  3. ExtensionHost discovers it on next reload (or hot, depending on the extension type).
  4. The WASM module exposes hooks: init, language registration, slash-command handlers, context-server connectors.
  5. The host calls those hooks during normal editor operation.

What extensions can contribute

  • Languages — full text-language definitions, registered through crates/language_extension.
  • Themes — theme TOML files (crates/theme_extension).
  • Snippets — JSON snippet bundles.
  • Slash commands — single-shot generators in the agent panel and elsewhere.
  • Context servers — external processes the agent can use as tools (MCP-style).
  • Debug adapters — DAP wrappers (crates/debug_adapter_extension).
  • Git hosting providers — extras that integrate with external Git hosts (crates/git_hosting_providers).
  • Indexed docs — the indexed-docs slash command.

First-party extensions

Bundled inside the repo at extensions/:

  • extensions/html/ — HTML language support
  • extensions/glsl/ — GLSL language support
  • extensions/proto/ — protobuf language support
  • extensions/test-extension/ — testing fixture
  • extensions/workflows/ — extension-related GitHub Actions

The top-level extensions/EXTRACTION.md and extensions/README.md describe the layout.

Integration points

  • Reads: extension.toml, the WASM blob, optional grammar/snippet/theme files.
  • Talks to: LanguageRegistry, ThemeRegistry, SnippetProvider, ContextServer registry, DapAdapter registry.
  • Bumping: .github/workflows/extension_bump.yml and extension_auto_bump.yml run extension_cli to publish updates.

Entry points for modification

  • Hosting features for a new contribution kind — extend crates/extension (new manifest entry) and crates/extension_host (new wiring).
  • Sandbox / WASM ABI — crates/extension_host.
  • The author-facing API — crates/extension_api.
  • The in-app UI — crates/extensions_ui.
  • Language services — where extension languages register
  • AI agent — context servers feed the agent
  • DAP — extension-contributed debug adapters

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Extensions – Zed wiki | Factory