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-06 02:24:40 +03:00 committed by GitHub
parent cc93175256
commit 9caa9d042a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 176 additions and 291 deletions

View file

@ -29,16 +29,14 @@ pub fn switch_source_header(
return;
};
let server_lookup =
find_specific_language_server_in_selection(editor, cx, is_c_language, CLANGD_SERVER_NAME);
let Some((_, _, server_to_query, buffer)) =
find_specific_language_server_in_selection(editor, cx, is_c_language, CLANGD_SERVER_NAME)
else {
return;
};
let project = project.clone();
let upstream_client = project.read(cx).lsp_store().read(cx).upstream_client();
cx.spawn_in(window, async move |_editor, cx| {
let Some((_, _, server_to_query, buffer)) =
server_lookup.await
else {
return Ok(());
};
let source_file = buffer.read_with(cx, |buffer, _| {
buffer.file().map(|file| file.path()).map(|path| path.to_string_lossy().to_string()).unwrap_or_else(|| "Unknown".to_string())
})?;