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:
parent
6d10b16f79
commit
8ec478cbcd
1 changed files with 3 additions and 5 deletions
|
@ -203,12 +203,10 @@ impl LspAdapter for RustLspAdapter {
|
||||||
language: &Arc<Language>,
|
language: &Arc<Language>,
|
||||||
) -> Option<CodeLabel> {
|
) -> Option<CodeLabel> {
|
||||||
let detail = completion
|
let detail = completion
|
||||||
.detail
|
|
||||||
.as_ref()
|
|
||||||
.or(completion
|
|
||||||
.label_details
|
.label_details
|
||||||
.as_ref()
|
.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);
|
.map(ToOwned::to_owned);
|
||||||
match completion.kind {
|
match completion.kind {
|
||||||
Some(lsp::CompletionItemKind::FIELD) if detail.is_some() => {
|
Some(lsp::CompletionItemKind::FIELD) if detail.is_some() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue