From 8ec478cbcd48874861574d92d499646b55ffa85d Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Thu, 4 Jul 2024 00:04:28 +0200 Subject: [PATCH] Rust: Prefer completion.label_details over completion.details (#13797) In doing so we get to surface origin packages more prominently. Fixes #13494 (again) Release Notes: - Fixed origin packages not being surfaced in Rust completions --- crates/languages/src/rust.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/languages/src/rust.rs b/crates/languages/src/rust.rs index a92021287c..6ad38e9829 100644 --- a/crates/languages/src/rust.rs +++ b/crates/languages/src/rust.rs @@ -203,12 +203,10 @@ impl LspAdapter for RustLspAdapter { language: &Arc, ) -> Option { let detail = completion - .detail + .label_details .as_ref() - .or(completion - .label_details - .as_ref() - .and_then(|detail| detail.detail.as_ref())) + .and_then(|detail| detail.detail.as_ref()) + .or(completion.detail.as_ref()) .map(ToOwned::to_owned); match completion.kind { Some(lsp::CompletionItemKind::FIELD) if detail.is_some() => {