mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
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
This commit is contained in:
parent
f326854495
commit
e5ce7cb19a
1 changed files with 22 additions and 0 deletions
|
|
@ -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<Option<zed::serde_json::Value>> {
|
||||
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<Option<zed_extension_api::serde_json::Value>> {
|
||||
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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue