Skip to content

Commit 94cea46

Browse files
committed
fix: add fallback for completion label details
1 parent 34cffbf commit 94cea46

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: crates/ide-completion/src/item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::{
2626
pub struct CompletionItem {
2727
/// Label in the completion pop up which identifies completion.
2828
pub label: SmolStr,
29-
/// Addition label details in the completion pop up that are
29+
/// Additional label details in the completion pop up that are
3030
/// displayed and aligned on the right side after the label.
3131
pub label_detail: Option<SmolStr>,
3232

Diff for: crates/rust-analyzer/src/lsp/to_proto.rs

+2
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ fn completion_item(
304304
detail: item.label_detail.as_ref().map(ToString::to_string),
305305
description: lsp_item.detail.clone(),
306306
});
307+
} else if let Some(label_detail) = item.label_detail {
308+
lsp_item.label.push_str(label_detail.as_str());
307309
}
308310

309311
set_score(&mut lsp_item, max_relevance, item.relevance);

0 commit comments

Comments
 (0)