From 0e31ae2cef92f973a6ee3def3f1feaa94dcb7a4f Mon Sep 17 00:00:00 2001 From: Josh Mcguigan Date: Mon, 22 Mar 2021 21:18:34 -0700 Subject: completion relevance distinguish between exact type match and could unify --- crates/ide_completion/src/render/enum_variant.rs | 4 ++-- crates/ide_completion/src/render/function.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ide_completion/src/render') diff --git a/crates/ide_completion/src/render/enum_variant.rs b/crates/ide_completion/src/render/enum_variant.rs index 374247b05..832f5ced1 100644 --- a/crates/ide_completion/src/render/enum_variant.rs +++ b/crates/ide_completion/src/render/enum_variant.rs @@ -6,7 +6,7 @@ use itertools::Itertools; use crate::{ item::{CompletionItem, CompletionKind, ImportEdit}, - render::{builder_ext::Params, compute_exact_type_match, compute_ref_match, RenderContext}, + render::{builder_ext::Params, compute_ref_match, compute_type_match, RenderContext}, CompletionRelevance, }; @@ -77,7 +77,7 @@ impl<'a> EnumRender<'a> { let ty = self.variant.parent_enum(self.ctx.completion.db).ty(self.ctx.completion.db); item.set_relevance(CompletionRelevance { - exact_type_match: compute_exact_type_match(self.ctx.completion, &ty), + type_match: compute_type_match(self.ctx.completion, &ty), ..CompletionRelevance::default() }); diff --git a/crates/ide_completion/src/render/function.rs b/crates/ide_completion/src/render/function.rs index b1eba20e8..d681e2c91 100644 --- a/crates/ide_completion/src/render/function.rs +++ b/crates/ide_completion/src/render/function.rs @@ -8,7 +8,7 @@ use syntax::ast::Fn; use crate::{ item::{CompletionItem, CompletionItemKind, CompletionKind, CompletionRelevance, ImportEdit}, render::{ - builder_ext::Params, compute_exact_name_match, compute_exact_type_match, compute_ref_match, + builder_ext::Params, compute_exact_name_match, compute_ref_match, compute_type_match, RenderContext, }, }; @@ -73,7 +73,7 @@ impl<'a> FunctionRender<'a> { let ret_type = self.func.ret_type(self.ctx.db()); item.set_relevance(CompletionRelevance { - exact_type_match: compute_exact_type_match(self.ctx.completion, &ret_type), + type_match: compute_type_match(self.ctx.completion, &ret_type), exact_name_match: compute_exact_name_match(self.ctx.completion, self.name.clone()), ..CompletionRelevance::default() }); -- cgit v1.2.3