From e5ce7cb19a2aa038a4f2f8bcc4c23b47fc18b241 Mon Sep 17 00:00:00 2001 From: Dario Date: Sat, 29 Nov 2025 11:19:23 +0100 Subject: [PATCH] extensions: Pass protobuf-language-server settings and initialization_options to the LSP (#43787) pass protobuf-language-server settings and initialization_options to the protobuf-language-server Closes #43786 Release Notes: - N/A --- extensions/proto/src/proto.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/extensions/proto/src/proto.rs b/extensions/proto/src/proto.rs index 70c5b9c84a9ecbb1b9567e75bf60b7d818525a5a..36ba0faf5feda66af8824387240e34a730a476b7 100644 --- a/extensions/proto/src/proto.rs +++ b/extensions/proto/src/proto.rs @@ -59,6 +59,28 @@ impl zed::Extension for ProtobufExtension { env: Default::default(), }) } + + fn language_server_workspace_configuration( + &mut self, + server_id: &zed::LanguageServerId, + worktree: &zed::Worktree, + ) -> Result> { + let settings = LspSettings::for_worktree(server_id.as_ref(), worktree) + .ok() + .and_then(|lsp_settings| lsp_settings.settings); + Ok(settings) + } + + fn language_server_initialization_options( + &mut self, + server_id: &zed::LanguageServerId, + worktree: &zed::Worktree, + ) -> Result> { + let initialization_options = LspSettings::for_worktree(server_id.as_ref(), worktree) + .ok() + .and_then(|lsp_settings| lsp_settings.initialization_options); + Ok(initialization_options) + } } zed::register_extension!(ProtobufExtension);