fern/01-guide/01-editors/zed.mdx
The BAML extension for Zed provides syntax highlighting and language server support for editing BAML files.
Cmd+Shift+X on macOS)The extension will automatically download and configure the BAML language server.
| Feature | Supported |
|---|---|
| Syntax highlighting for BAML files | ✅ |
| Language Server Protocol (LSP) integration | ✅ |
| Jump to definition | ✅ |
| Error diagnostics | ✅ |
| LLM playground (via browser) | ✅ |
The BAML Playground runs as a local server and can be accessed via your browser:
Cmd+Shift+P (macOS) or Ctrl+Shift+P (Linux)127.0.0.1:3704)In VS Code, Cursor, and JetBrains, you'll see an "Open Playground" button above each BAML function. Unfortunately, Zed doesn't yet support the LSP features needed to make this work:
Once Zed adds these features, the playground will be accessible with a single click. Until then, the LSP logs workaround above is the way to go. You can follow the linked GitHub issues to track progress. </Note>
The Zed extension includes:
You can set environment variables (like API keys) in the BAML Playground via your browser. Click on the Settings button in the playground to configure them.
Alternatively, you can set environment variables in your shell or through a .env file in your project root. The BAML language server will pick up variables from your environment.
Make sure you're running a recent version of Zed. The BAML extension requires Zed's extension system.
If the language server fails to start:
Ensure your files have the .baml extension. The extension only activates for files with this extension.
The Zed extension is developed as part of the BAML monorepo:
If you encounter any issues or have feature requests, please: