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:
Kirill Bulatov
2025-08-05 23:24:40 +00:00
committed by GitHub
parent cc93175256
commit 9caa9d042a
14 changed files with 176 additions and 291 deletions
+11 -11
View File
@@ -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(