Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/render/function.rs')
-rw-r--r--crates/ide-completion/src/render/function.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/crates/ide-completion/src/render/function.rs b/crates/ide-completion/src/render/function.rs
index b306bede65..6ad84eba33 100644
--- a/crates/ide-completion/src/render/function.rs
+++ b/crates/ide-completion/src/render/function.rs
@@ -74,10 +74,13 @@ fn render(
);
let ret_type = func.ret_type(db);
- let is_op_method = func
- .as_assoc_item(ctx.db())
- .and_then(|trait_| trait_.containing_trait_or_trait_impl(ctx.db()))
- .map_or(false, |trait_| completion.is_ops_trait(trait_));
+ let assoc_item = func.as_assoc_item(db);
+
+ let trait_ = assoc_item.and_then(|trait_| trait_.containing_trait_or_trait_impl(db));
+ let is_op_method = trait_.map_or(false, |trait_| completion.is_ops_trait(trait_));
+
+ let is_item_from_notable_trait =
+ trait_.map_or(false, |trait_| completion.is_doc_notable_trait(trait_));
let (has_dot_receiver, has_call_parens, cap) = match func_kind {
FuncKind::Function(&PathCompletionCtx {
@@ -105,6 +108,7 @@ fn render(
},
exact_name_match: compute_exact_name_match(completion, &call),
is_op_method,
+ is_item_from_notable_trait,
..ctx.completion_relevance()
});
@@ -141,7 +145,7 @@ fn render(
item.add_import(import_to_add);
}
None => {
- if let Some(actm) = func.as_assoc_item(db) {
+ if let Some(actm) = assoc_item {
if let Some(trt) = actm.containing_trait_or_trait_impl(db) {
item.trait_name(trt.name(db).to_smol_str());
}