feat: Deprioritize completions of private but editable definitions

This commit is contained in:
Lukas Wirth
2022-02-02 02:05:49 +01:00
parent d7a544e69a
commit 5c41f5d165
12 changed files with 120 additions and 58 deletions

View File

@@ -41,7 +41,7 @@ pub(crate) fn render_method(
}
fn render(
ctx @ RenderContext { completion }: RenderContext<'_>,
ctx @ RenderContext { completion, .. }: RenderContext<'_>,
local_name: Option<hir::Name>,
func: hir::Function,
func_type: FuncType,
@@ -75,7 +75,7 @@ fn render(
type_match: compute_type_match(completion, &ret_type),
exact_name_match: compute_exact_name_match(completion, &call),
is_op_method,
..CompletionRelevance::default()
..ctx.completion_relevance()
});
if let Some(ref_match) = compute_ref_match(completion, &ret_type) {