Use new language server info on remote servers (#35682)
* Straightens out the `*_ext.rs` workflow for clangd and rust-analyzer: no need to asynchronously query for the language server, as we sync that information already. * Fixes inlay hints editor menu toggle not being shown in the remote sessions Release Notes: - Fixed inlay hints editor menu toggle not being shown in the remote sessions
This commit is contained in:
parent
cc93175256
commit
9caa9d042a
14 changed files with 176 additions and 291 deletions
|
@ -3284,6 +3284,16 @@ impl InlayHints {
|
|||
})
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
pub fn check_capabilities(capabilities: &ServerCapabilities) -> bool {
|
||||
capabilities
|
||||
.inlay_hint_provider
|
||||
.as_ref()
|
||||
.is_some_and(|inlay_hint_provider| match inlay_hint_provider {
|
||||
lsp::OneOf::Left(enabled) => *enabled,
|
||||
lsp::OneOf::Right(_) => true,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait(?Send)]
|
||||
|
@ -3297,17 +3307,7 @@ impl LspCommand for InlayHints {
|
|||
}
|
||||
|
||||
fn check_capabilities(&self, capabilities: AdapterServerCapabilities) -> bool {
|
||||
let Some(inlay_hint_provider) = &capabilities.server_capabilities.inlay_hint_provider
|
||||
else {
|
||||
return false;
|
||||
};
|
||||
match inlay_hint_provider {
|
||||
lsp::OneOf::Left(enabled) => *enabled,
|
||||
lsp::OneOf::Right(inlay_hint_capabilities) => match inlay_hint_capabilities {
|
||||
lsp::InlayHintServerCapabilities::Options(_) => true,
|
||||
lsp::InlayHintServerCapabilities::RegistrationOptions(_) => false,
|
||||
},
|
||||
}
|
||||
Self::check_capabilities(&capabilities.server_capabilities)
|
||||
}
|
||||
|
||||
fn to_lsp(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue