Skip to content

Commit 0fb804a

Browse files
committed
Auto merge of #18245 - boattime:master, r=davidbarsky
fix: include description in label details when detail field is marked for … Fixes #18231. When omitting the autocomplete detail field, the autocomplete label details can still be returned. Currently the label details are missing the description field if the detail field is included in resolveSupport since it is being overwritten as None and opted to be sent with `completionItem/resolve`. Example completion capabilities. ``` completion = { completionItem = { commitCharactersSupport = true, deprecatedSupport = true, documentationFormat = { "markdown", "plaintext" }, insertReplaceSupport = true, insertTextModeSupport = { valueSet = { 1, 2 } }, labelDetailsSupport = true, preselectSupport = true, resolveSupport = { properties = { "documentation", "detail", "additionalTextEdits", "sortText", "filterText", "insertText", "textEdit", "insertTextFormat", "insertTextMode" } }, snippetSupport = true, tagSupport = { valueSet = { 1 } } } ```
2 parents 7692c82 + b857a0b commit 0fb804a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/rust-analyzer/src/lsp/to_proto.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ fn completion_item(
339339
something_to_resolve |= item.detail.is_some();
340340
None
341341
} else {
342-
item.detail
342+
item.detail.clone()
343343
};
344344

345345
let documentation = if fields_to_resolve.resolve_documentation {
@@ -370,7 +370,7 @@ fn completion_item(
370370
} else {
371371
lsp_item.label_details = Some(lsp_types::CompletionItemLabelDetails {
372372
detail: item.label_detail.as_ref().map(ToString::to_string),
373-
description: lsp_item.detail.clone(),
373+
description: item.detail,
374374
});
375375
}
376376
} else if let Some(label_detail) = item.label_detail {

0 commit comments

Comments
 (0)