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
This commit is contained in:
Piotr Osiewicz 2024-07-04 00:04:28 +02:00 committed by GitHub
parent 6d10b16f79
commit 8ec478cbcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -203,12 +203,10 @@ impl LspAdapter for RustLspAdapter {
language: &Arc<Language>,
) -> Option<CodeLabel> {
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() => {