fix Zed go lsp error

前言 前段时间在使用 Zed 编辑器时,出现了 go lsp 启动错误,未能正确找到 go 语言的二进制文件。 本文将一步步从源代码分析修复 Zed 的 go lsp 启动错误。 步骤 从错误信息可以得知,具体的逻辑在 /crates/languages/src/go.rs#L76,可以看到是 delegate.which("go".as_ref()).await.is_none() 方法的返回值为 true,导致 go 语言的二进制文件未找到。 接下来寻找 which 方法的定义位置,可以看到是在 /crates/project/src/lsp_store.rs#L12758,这段代码实现了 LspAdapterDelegate trait 中的 which 方法,用于在系统中查找可执行文件的路径。 修改 which 方法,添加一些日志,以便更好地理解其执行过程。 async fn which(&self, command: &OsStr) -> Option<PathBuf> { let mut worktree_abs_path = self.worktree_root_path().to_path_buf(); if self.fs.is_file(&worktree_abs_path).await { worktree_abs_path.pop(); } let shell_path = self.shell_env().await.get("PATH").cloned(); // Debug output log::info!( "which() called for command: {:?}, worktree_abs_path: {:?}, shell_path: {:?}", command, worktree_abs_path, shell_path ); let result = which::which_in(command, shell_path.as_ref(), worktree_abs_path).ok(); log::info!("which() result for {:?}: {:?}", command, result); result } 重新编译运行 Zed,查看日志: ...

十月 20, 2025 · 3 分钟 · overstarry

Building Zed for Windows

前言 本文将介绍如何在 Windows11 上构建 Zed 编辑器。 依赖性 Zed 是由 rust 编写的,因此需要安装 rust 工具链。 安装 Visual Studio 2022 ,安装符合电脑架构的 C++ 工具集。 主要是如下组件: { "version": "1.0", "components": [ "Microsoft.VisualStudio.Component.CoreEditor", "Microsoft.VisualStudio.Workload.CoreEditor", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", "Microsoft.VisualStudio.Component.Windows11SDK.26100", "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.CMake", "Microsoft.VisualStudio.Component.VC.CMake.Project", "Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre" ], "extensions": [] } 构建 安装完依赖项后,可以从源代码构建 Zed 编辑器。 Clone Zed Repository gh repo clone overstarry/zed cd zed 构建 debug 版本 cargo run 编译中出现了 ,需要将前面安装的 cmake 添加到环境变量中。 设置完,重新运行 cargo run 即可。 ...

十月 19, 2025 · 1 分钟 · overstarry

zed 配置 codex acp

前言 在前面的文章![https://jasminides.com/posts/zed-acp-claude-code/] 介绍了如何在 zed 中 配置 Claude Code, 本文将介绍如何在 zed 编辑器中安装配置使用 codex。 安装 本文使用的环境是 Windows11 下的 wsl,进入 wsl,输入wget https://github.com/zed-industries/codex-acp/releases/download/0.2.4/codex-acp-0.2.4-x86_64-unknown-linux-gnu.tar.gz 下载 codex-acp, 使用 tar -xvf codex-acp-0.2.4-x86_64-unknown-linux-gnu.tar.gz 解压,将解压后的文件移动到 /usr/local/bin 目录下。 配置 codex-acp 的配置很简单,打开 zed 的设置,填入设置: { "agent_servers": { "Custom Codex Agent": { "command": "/usr/local/bin/codex-acp", "args": [], "env": {} } } } 设置完打开 Agent 面板就可以看到外部 Agents 的选项中已有 Custom Codex Agent 选项。 输入消息,顺利得到回复。 小结 本文介绍了如何在 Zed 编辑器中安装和配置 codex-acp,详细说明了下载、解压、移动可执行文件以及在 Zed 设置中添加自定义 Agent 的步骤。通过简单的配置,即可在 Zed 中顺利使用 Codex Agent,提升了编辑器的智能化体验。期待未来官方带来更多 agent 的集成。 ...

十月 10, 2025 · 1 分钟 · overstarry

Zed acp-claude-code

前言 zed 在 0.201.4 版本推出了应用 Agent Client Protocol (ACP) 协议的第一个正式版本,Agent Client Protocol (ACP) 是一个将外部 Agents 与编辑器集成的开放协议,zed 在这个版本中集成了 Google Gemini CLI , 开发者可以自己开发兼容 ACP 的自定义代理,本文就是讲述如何安装配置 acp-claude-code 以在 zed 更方便的使用 Claude Code. 配置 acp-claude-code 的配置很简单,打开 zed 的设置,填入设置: { "agent_servers": { "Claude Code": { "command": "npx", "args": ["acp-claude-code"] } } } 设置完打开 Agent 面板就可以看到外部 Agents的选项中已有 Claude Code 选项。 新建 Claude Code 线程,发现报错了,提示 program not found 。 根据以往的经验,这种错误主要发生在 windows 系统上,windows 系统的用户应该使用如下配置。 ...

九月 1, 2025 · 1 分钟 · overstarry