aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/rust-analyzer/src/to_proto.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index ef9e0aee9..0a3a56773 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -270,9 +270,12 @@ pub(crate) fn completion_item(
270 set_score(&mut lsp_item_with_ref, relevance); 270 set_score(&mut lsp_item_with_ref, relevance);
271 lsp_item_with_ref.label = 271 lsp_item_with_ref.label =
272 format!("&{}{}", mutability.as_keyword_for_ref(), lsp_item_with_ref.label); 272 format!("&{}{}", mutability.as_keyword_for_ref(), lsp_item_with_ref.label);
273 if let Some(lsp_types::CompletionTextEdit::Edit(it)) = &mut lsp_item_with_ref.text_edit 273 if let Some(it) = &mut lsp_item_with_ref.text_edit {
274 { 274 let new_text = match it {
275 it.new_text = format!("&{}{}", mutability.as_keyword_for_ref(), it.new_text); 275 lsp_types::CompletionTextEdit::Edit(it) => &mut it.new_text,
276 lsp_types::CompletionTextEdit::InsertAndReplace(it) => &mut it.new_text,
277 };
278 *new_text = format!("&{}{}", mutability.as_keyword_for_ref(), new_text);
276 } 279 }
277 vec![lsp_item_with_ref, lsp_item] 280 vec![lsp_item_with_ref, lsp_item]
278 } 281 }