Rust-based Zed editor now open source – with built-in support for OpenAI and GitHub Copilot

Rust-based Zed editor now open source – with built-in support for OpenAI and GitHub Copilot
Code

The Zed editor project – which remains a pre-release – is now open source under the AGPL, GPL and Apache licenses, with fast performance and a choice of AI assistants, though still in preview and Mac-only.

A post yesterday by Zed founder Nathan Sobo explained that Zed, on GitHub here, uses GPL for the editor, AGPL (GNU Affero General Public License) for server-side components, and Apache 2 for GPUI (GPU-accelerated UI), which is a Rust UI framework developed by the Zed team.

Sobo previously created the Atom editor and the Electron framework, the second of which is used by Visual Studio Code (VS Code), the world’s most popular editor and lightweight IDE. Electron is based on Chromium browser components and the V8 JavaScript engine, whereas Zed has a very different codebase, being built in Rust and compiled to native code. 

Unlike VS Code, for which more than 55,000 extensions are available, Zed has only the beginnings of a plugin model and there is no extension ecosystem; the FAQ states that “We won’t add a plugin system before we open source Zed, but once that is complete, we will be working on extensibility,” which suggests there will be more work on this soon.

The high performance of Rust, combined with the lack of plugins, means that Zed is fast, tapping into the biggest frustration that developers have with VS Code: performance. “VSCode has always felt incredibly slow to me … VSC’s lag in basic code inspection and linting became so annoying I had to switch off it,” said one developer commenting on the Zed news; and another said “for those who haven’t used Zed, it’s the first GUI editor I’ve used in 25-years of development that wasn’t distracting. It’s hard to describe how much more focused I am when not distracted with a Christmas tree scene of icons, menus, colors, etc. like you see in other editors.”

Zed’s approach to AI assistance, though raw in feel, may please those who prefer maximum control. Zed comes with support for both GitHub Copilot and OpenAI. Regarding Copilot, Zed team member Mikayla Maki said that “balancing its visual and mental burden was crucial, as an over-eager Copilot could be counterproductive and cause conflicts with pre-existing features like LSP autocomplete. We introduced settings to disable Copilot per language, added a 75ms debounce before suggesting text, and prioritized the language’s real LSP [Language Server Protocol] over Copilot when conflicts arose.”

The Zed OpenAI assistant panel (image from Zed documentation)

Zed’s OpenAI assistant panel is a different feature that is highly configurable. Developers can choose the type of model and change this at any time, even during an AI conversation. An OpenAI account is required, with an API key configured in Zed. These keys are billed by the number of tokens used, and Zed shows the remaining token count for the selected model at all times. Interactions with OpenAI large language models are submitted with CMD-Enter, rather than just enter, the idea being to make it “feel as close to a regular editor as possible. So pressing enter simply inserts a newline.” This also means it is hard to consume tokens by accident. The response is streamed back and if it looks unhelpful, it can be cancelled with Escape. 

There is also an inline assistant feature which can see the context of the surrounding code. Marshall Bowers, another Zed team member, posted about using the AI for inline documentation and for translating code from one template system to another, with commands like “Rewrite this HTML using auk’s DSL like the post_link function above.” He said AI ended up being used to help with the majority of this template code.

According to the roadmap, AI support without requiring an OpenAI key is planned, as well as AI inline assistance in the terminal, a simplified assistant interface, and giving the AI access to “access to buffers, files, LSP, the terminal prompt, etc inline.” 

Along with the lack of extensions, there are some other snags with Zed. Language support is limited with Rust, TypeScript and Python well supported, many others with some support, and some (Microsoft’s C# for example) lacking any support, though the feature description states: “The ability to connect Zed with an arbitrary language server is under active development.”

Another issue is that Zed is Mac only. There is a GitHub issue for this which says that support for other platforms is planned. The roadmap includes Linux and web support (with web perhaps using WebAssembly, which Rust can target), but does not mention Windows at the time of writing, which suggests that this may take longer other than via Windows Subsystem for Linux.