aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-03-09 14:42:05 +0000
committerAleksey Kladov <[email protected]>2021-03-09 14:42:05 +0000
commit444d67ae1802d2832b3bcdc0ff593b014477b37b (patch)
treecaf7102e92020b7cc5293674dd2576744a6601e8 /crates/ide_completion/src
parent2cc278c6ffa900d9fba8e19c5a1fc6996fbe6639 (diff)
Cleanup
Diffstat (limited to 'crates/ide_completion/src')
-rw-r--r--crates/ide_completion/src/item.rs7
-rw-r--r--crates/ide_completion/src/render.rs8
2 files changed, 7 insertions, 8 deletions
diff --git a/crates/ide_completion/src/item.rs b/crates/ide_completion/src/item.rs
index 9b039e3e5..b6bc11da2 100644
--- a/crates/ide_completion/src/item.rs
+++ b/crates/ide_completion/src/item.rs
@@ -430,11 +430,8 @@ impl Builder {
430 self.import_to_add = import_to_add; 430 self.import_to_add = import_to_add;
431 self 431 self
432 } 432 }
433 pub(crate) fn set_ref_match( 433 pub(crate) fn ref_match(mut self, ref_match: (Mutability, CompletionScore)) -> Builder {
434 mut self, 434 self.ref_match = Some(ref_match);
435 ref_match: Option<(Mutability, CompletionScore)>,
436 ) -> Builder {
437 self.ref_match = ref_match;
438 self 435 self
439 } 436 }
440} 437}
diff --git a/crates/ide_completion/src/render.rs b/crates/ide_completion/src/render.rs
index fae5685e2..0a6ac8804 100644
--- a/crates/ide_completion/src/render.rs
+++ b/crates/ide_completion/src/render.rs
@@ -246,7 +246,6 @@ impl<'a> Render<'a> {
246 } 246 }
247 }; 247 };
248 248
249 let mut ref_match = None;
250 if let ScopeDef::Local(local) = resolution { 249 if let ScopeDef::Local(local) = resolution {
251 if let Some((active_name, active_type)) = self.ctx.active_name_and_type() { 250 if let Some((active_name, active_type)) = self.ctx.active_name_and_type() {
252 let ty = local.ty(self.ctx.db()); 251 let ty = local.ty(self.ctx.db());
@@ -255,7 +254,11 @@ impl<'a> Render<'a> {
255 { 254 {
256 item = item.set_score(score); 255 item = item.set_score(score);
257 } 256 }
258 ref_match = refed_type_matches(&active_type, &active_name, &ty, &local_name); 257 if let Some(ref_match) =
258 refed_type_matches(&active_type, &active_name, &ty, &local_name)
259 {
260 item = item.ref_match(ref_match);
261 }
259 } 262 }
260 } 263 }
261 264
@@ -285,7 +288,6 @@ impl<'a> Render<'a> {
285 Some( 288 Some(
286 item.kind(kind) 289 item.kind(kind)
287 .add_import(import_to_add) 290 .add_import(import_to_add)
288 .set_ref_match(ref_match)
289 .set_documentation(self.docs(resolution)) 291 .set_documentation(self.docs(resolution))
290 .set_deprecated(self.is_deprecated(resolution)) 292 .set_deprecated(self.is_deprecated(resolution))
291 .build(), 293 .build(),