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.
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)The playground server starts automatically when the BAML language server initializes. If you don’t see the message, try restarting the language server.
Why can’t I just click “Open Playground” like in VS Code?
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.
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.
Environment variables set in the playground are stored locally and persist between sessions.
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: