aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/to_proto.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-03-09 15:06:08 +0000
committerAleksey Kladov <[email protected]>2021-03-09 15:06:08 +0000
commit12fe301a0cbe4ffecdabae1c9b827e740e3ce027 (patch)
treee1442b7be6fb8728b473a3e73d63c6445a211586 /crates/rust-analyzer/src/to_proto.rs
parentabc0ed36bdf4975dc9c5fb2ddd3f960ad2db5494 (diff)
Cleanup auto-ref in completion
Diffstat (limited to 'crates/rust-analyzer/src/to_proto.rs')
-rw-r--r--crates/rust-analyzer/src/to_proto.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index 261d9fb18..a730fb448 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -232,9 +232,8 @@ pub(crate) fn completion_item(
232 } 232 }
233 233
234 let mut res = match item.ref_match() { 234 let mut res = match item.ref_match() {
235 Some(ref_match) => { 235 Some(mutability) => {
236 let mut refed = lsp_item.clone(); 236 let mut refed = lsp_item.clone();
237 let (mutability, _score) = ref_match;
238 let label = format!("&{}{}", mutability.as_keyword_for_ref(), refed.label); 237 let label = format!("&{}{}", mutability.as_keyword_for_ref(), refed.label);
239 set_score(&mut refed, &label); 238 set_score(&mut refed, &label);
240 refed.label = label; 239 refed.label = label;
@@ -243,8 +242,8 @@ pub(crate) fn completion_item(
243 None => vec![lsp_item], 242 None => vec![lsp_item],
244 }; 243 };
245 244
246 for mut r in res.iter_mut() { 245 for lsp_item in res.iter_mut() {
247 r.insert_text_format = Some(insert_text_format(item.insert_text_format())); 246 lsp_item.insert_text_format = Some(insert_text_format(item.insert_text_format()));
248 } 247 }
249 res 248 res
250} 249}