Home > Technology peripherals > AI > Rust-based Zed editor has been open sourced, with built-in support for OpenAI and GitHub Copilot

Rust-based Zed editor has been open sourced, with built-in support for OpenAI and GitHub Copilot

王林
Release: 2024-02-01 14:51:18
forward
1003 people have browsed it

Author丨Tim Anderson

Compilation丨Noah

produced | 51CTO Technology Stack (WeChat ID: blog51cto)

Zed Editor Project It is still in the pre-release stage and is open source under AGPL, GPL and Apache licenses. The editor features high performance and multiple AI-assisted options, but is currently only available on the Mac platform.

Nathan Sobo explained in a post that in Project Zed’s code base on GitHub, the editor part is licensed under the GPL, and the server-side components The AGPL license is used, and the GPUI (GPU Accelerated User Interface) part uses the Apache 2.0 license. GPUI is a Rust UI framework developed by the Zed team. Such a license choice ensures the openness and accessibility of the code, allowing Zed to be widely used and contributed to in the open source community.

Sobo previously created the Atom editor and the Electron framework. The Electron framework is used by VS Code, the world's most popular editor and lightweight IDE. Electron is built using Chromium browser components and the V8 JavaScript engine, while Zed has a completely different code base. It is written in Rust and compiled into native code.

Unlike VS Code, which has more than 55,000 extension plug-ins, Zed currently only has a preliminary plug-in model and has not formed a complete extension ecosystem; its FAQ states, "In Zed We will not add a plug-in system before open source, but once the open source is completed, we will work on the development of extensibility functions." This indicates that there will be more work in this area in the near future.

Thanks to Rust's high performance and lack of plug-ins, Zed runs extremely fast, providing a solution to developers' biggest pain point with VS Code - performance issues.

A developer commented on Zed News and said: "VSCode always feels extremely slow to me... VSCode's lag in basic code inspection and syntax detection makes me extremely annoyed. , and eventually had to give up using it."

Another developer said: "For those who haven't tried Zed, it's the best experience in my 25 years of development. The most distracting GUI editor I've ever used. It's hard to describe how much my concentration improved when I got rid of the various icons, menus, colors and other Christmas tree-like scenes in other editors."

Although the AI ​​assistance function provided by Zed is still rough in experience, developers who prefer maximum control may be satisfied. Zed supports both GitHub Copilot and OpenAI.

Regarding the integration of Copilot, Zed team member Mikayla Maki said: "It is crucial to balance its visual and psychological burden, because an overly aggressive Copilot can be counterproductive and interfere with existing auto-completions such as LSP features such as Copilot. Therefore, we have introduced settings to disable Copilot by language, increase the text suggestion delay by 75 milliseconds, and prioritize the language's own LSP (Language Server Protocol) over Copilot in the event of a conflict."

基于Rust的Zed编辑器已开源,内置对OpenAI和GitHub Copilot的支持Picture

Zed Editor’s OpenAI Assistant Panel is a highly configurable and unique feature. Developers can choose the model type and change the model at any time, even during a conversation with the AI. To use this feature, you need to have an OpenAI account and configure an API key in Zed. These keys are billed by the number of tokens used, and Zed will always display the number of tokens remaining for the selected model.

Interactions with OpenAI's large language models are submitted via CMD-Enter instead of just the Enter key, the idea is to keep it as close to a regular editor feel as possible, so Pressing the Enter key will only insert a new line." This also means that it is difficult for users to accidentally consume tokens. The response content is returned in real time, and if it seems unhelpful, the request can be canceled by pressing the Escape key.

In addition, Zed also has an inline assistant function that can view contextual information of the surrounding code. Marshall Bowers, another member of the Zed team, has posted about using AI for inline document writing and translating code from one template system to another, such as performing tasks like “Rewrite this HTML using auk’s DSL method. , just like the post_link function above" command. He said that when processing most of the template code, AI was ultimately used to assist.

According to the roadmap, in the future Zed will support AI assistance functions without OpenAI keys, while providing inline intelligent assistance in the terminal, a simplified assistant interface, and enabling AI to "Access buffers, files, LSPs, terminal prompts, etc. in inline state".

In addition to the lack of extensions, Zed has some other problems. Currently, support for languages ​​such as Rust, TypeScript, and Python is relatively good, and many other languages ​​are partially supported, but there are also some languages, such as Microsoft's C#, that have not yet received any support, although the feature description mentions: "Active development is underway to use Zed The ability to connect to any language server".

Another problem is that Zed is currently only available on the Mac platform. There is a GitHub issue regarding this issue stating that there are plans to add support for other platforms. Linux and web-side support are included in the roadmap (the web-side may adopt WebAssembly technology that Rust can compile to target), but there is no mention of the Windows platform at the time of writing, suggesting that development of the Windows version may take more time, or Users need to use it indirectly through Windows Subsystem for Linux (WSL).

Reference link: https://devclass.com/2024/01/25/rust-based-zed-editor-now-open-source-with-built-in-support -for-openai-and-github-copilot/

The above is the detailed content of Rust-based Zed editor has been open sourced, with built-in support for OpenAI and GitHub Copilot. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:51cto.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template