Extensions Overview
Zed extensions are modular packages that add functionality to the editor. Extensions can provide language support, themes, debuggers, AI tools, and custom commands.What Extensions Can Do
Zed extensions support a wide range of capabilities:Language Support
Extensions can add support for programming languages, including:- Syntax highlighting via Tree-sitter grammars
- Language servers for IDE features (autocomplete, go-to-definition, diagnostics)
- Language configuration (comment syntax, bracket pairs, file extensions)
- Code queries for bracket matching, outline structure, and auto-indentation
Themes and Visual Customization
Extensions can customize Zed’s appearance:- Color themes for light and dark modes
- Icon themes for file and folder icons
- Syntax highlighting colors for different token types
Development Tools
- Debug adapters for stepping through code and inspecting variables
- Slash commands for custom AI assistant commands
- MCP servers for AI context providers
- Agent servers for custom AI integrations
Extension Capabilities
Extensions run in a sandboxed WebAssembly environment and can:- Download and manage language server binaries
- Install npm packages
- Execute commands with explicit permissions
- Read project files and environment variables
- Provide custom completions and labels
How Extensions Work
Extensions are written in Rust and compiled to WebAssembly (WASM). The WebAssembly architecture provides:- Security: Extensions run in a sandboxed environment with restricted capabilities
- Performance: Native-speed execution for language processing
- Cross-platform: Extensions work on macOS, Linux, and Windows
Extension Structure
An extension is a Git repository containing:Extension Manifest
Theextension.toml file defines the extension’s metadata and capabilities:
Extension Registry
Zed extensions are published to the zed-industries/extensions registry. The registry:- Hosts extension metadata and manifests
- Builds extensions to WASM
- Distributes extensions to users
- Manages version updates
Extension API
Extensions interact with Zed through thezed_extension_api Rust crate. The API provides:
Core Traits
Helper Functions
The API provides utilities for common tasks:Example Extensions
The Zed repository includes several example extensions:- test-extension: Demonstrates language server installation and configuration
- html: Shows npm package installation and LSP integration
- slash-commands-example: Implements custom slash commands
- glsl: Simple grammar-only extension
Next Steps
- Installing Extensions: Browse and install extensions from the marketplace
- Developing Extensions: Create your own extensions
- Language Extensions: Add programming language support
- Theme Extensions: Create custom themes
