From 71cbfc65b1679832f08b1d7c1c8ff74cf628dcb2 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Sat, 20 Jul 2024 16:09:53 +0200 Subject: [PATCH] Ruff: pass initialization_options from settings (#14866) No version bump, as the extension is not out yet. Release Notes: - N/A --- extensions/ruff/src/ruff.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/extensions/ruff/src/ruff.rs b/extensions/ruff/src/ruff.rs index 960c263214..5a82530f23 100644 --- a/extensions/ruff/src/ruff.rs +++ b/extensions/ruff/src/ruff.rs @@ -106,6 +106,18 @@ impl zed::Extension for RuffExtension { }) } + fn language_server_initialization_options( + &mut self, + server_id: &LanguageServerId, + worktree: &zed_extension_api::Worktree, + ) -> Result> { + let settings = LspSettings::for_worktree(server_id.as_ref(), worktree) + .ok() + .and_then(|lsp_settings| lsp_settings.initialization_options.clone()) + .unwrap_or_default(); + Ok(Some(settings)) + } + fn language_server_workspace_configuration( &mut self, server_id: &LanguageServerId,