aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/render.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_completion/src/render.rs')
-rw-r--r--crates/ide_completion/src/render.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide_completion/src/render.rs b/crates/ide_completion/src/render.rs
index 12921e12b..23e00aa47 100644
--- a/crates/ide_completion/src/render.rs
+++ b/crates/ide_completion/src/render.rs
@@ -219,6 +219,7 @@ impl<'a> Render<'a> {
219 hir::GenericParam::ConstParam(_) => SymbolKind::ConstParam, 219 hir::GenericParam::ConstParam(_) => SymbolKind::ConstParam,
220 }), 220 }),
221 ScopeDef::Local(..) => CompletionItemKind::SymbolKind(SymbolKind::Local), 221 ScopeDef::Local(..) => CompletionItemKind::SymbolKind(SymbolKind::Local),
222 ScopeDef::Label(..) => CompletionItemKind::SymbolKind(SymbolKind::Label),
222 ScopeDef::AdtSelfType(..) | ScopeDef::ImplSelfType(..) => { 223 ScopeDef::AdtSelfType(..) | ScopeDef::ImplSelfType(..) => {
223 CompletionItemKind::SymbolKind(SymbolKind::SelfParam) 224 CompletionItemKind::SymbolKind(SymbolKind::SelfParam)
224 } 225 }
@@ -243,7 +244,7 @@ impl<'a> Render<'a> {
243 244
244 item.set_relevance(CompletionRelevance { 245 item.set_relevance(CompletionRelevance {
245 exact_type_match: compute_exact_type_match(self.ctx.completion, &ty), 246 exact_type_match: compute_exact_type_match(self.ctx.completion, &ty),
246 exact_name_match: compute_exact_name_match(self.ctx.completion, local_name.clone()), 247 exact_name_match: compute_exact_name_match(self.ctx.completion, &local_name),
247 is_local: true, 248 is_local: true,
248 ..CompletionRelevance::default() 249 ..CompletionRelevance::default()
249 }); 250 });
@@ -319,8 +320,7 @@ fn compute_exact_type_match(ctx: &CompletionContext, completion_ty: &hir::Type)
319 320
320fn compute_exact_name_match(ctx: &CompletionContext, completion_name: impl Into<String>) -> bool { 321fn compute_exact_name_match(ctx: &CompletionContext, completion_name: impl Into<String>) -> bool {
321 let completion_name = completion_name.into(); 322 let completion_name = completion_name.into();
322 323 ctx.expected_name.as_ref().map_or(false, |name| name.text() == completion_name)
323 Some(&completion_name) == ctx.expected_name.as_ref()
324} 324}
325 325
326fn compute_ref_match(ctx: &CompletionContext, completion_ty: &hir::Type) -> Option<Mutability> { 326fn compute_ref_match(ctx: &CompletionContext, completion_ty: &hir::Type) -> Option<Mutability> {