Ruff: pass initialization_options from settings (#14866)

No version bump, as the extension is not out yet.
Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-07-20 16:09:53 +02:00 committed by GitHub
parent 1218a846c1
commit 71cbfc65b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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<Option<zed_extension_api::serde_json::Value>> {
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,