From 6d49e14680151f6f4278f07078c5a5579e9e001c Mon Sep 17 00:00:00 2001 From: kunlinglio <142668432+kunlinglio@users.noreply.github.com> Date: Fri, 2 Oct 2026 12:00:57 +0800 Subject: [PATCH] Fix wrong configuration key in Zed extension --- CHANGELOG.md | 4 ++++ extensions/zed/src/lib.rs | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc45d00..03d8242 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to the Path Server will be documented in this file. +## [Unreleased] +### Fixed +- **Zed**: Fixed an issue where Zed extension read settings from `lsp.path-server.settings` rather than `lsp.path-server-lsp.settings`. ([#55](https://github.com/kunlinglio/path-server/issues/55)) + ## [1.4.2] - 2026-09-14 Path Server is now published to Open VSX! You can now view it at https://open-vsx.org/extension/LKL/path-server ### Fixed diff --git a/extensions/zed/src/lib.rs b/extensions/zed/src/lib.rs index 0741c0a..de553fe 100644 --- a/extensions/zed/src/lib.rs +++ b/extensions/zed/src/lib.rs @@ -95,12 +95,12 @@ impl PathServerExtension { return Err("No asset found with name.".to_string()); }; - // 3. create dir: path-server-vx.x.x + // 4. create dir: path-server-vx.x.x let Ok(_) = std::fs::create_dir_all(EXECUTABLE_DIR) else { return Err("Failed to create executable directory.".to_string()); }; - // 4. download executable + // 5. download executable let binary_path = format!("{EXECUTABLE_DIR}/{}", asset.name); if !std::fs::metadata(&binary_path).is_ok_and(|stat| stat.is_file()) { zed::set_language_server_installation_status( @@ -118,7 +118,7 @@ impl PathServerExtension { return Err("Failed to make executable.".to_string()); }; - // 5. clean up old versions + // 6. clean up old versions let Ok(entries) = std::fs::read_dir(EXECUTABLE_DIR) else { zed::set_language_server_installation_status( language_server_id, @@ -247,13 +247,16 @@ impl zed::Extension for PathServerExtension { fn language_server_workspace_configuration( &mut self, - _server_id: &zed::LanguageServerId, + server_id: &zed::LanguageServerId, worktree: &zed::Worktree, ) -> zed::Result> { - let settings = LspSettings::for_worktree("path-server", worktree) + let settings = LspSettings::for_worktree(server_id.as_ref(), worktree) .ok() .and_then(|lsp_settings| lsp_settings.settings) .unwrap_or_default(); + + // Convert configuration key into `path-server` + // See `config::get` in the path-server crate (src/config.rs) Ok(Some(serde_json::json!({ "path-server": settings })))