mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
feat: Deprioritize ops methods in completion
This commit is contained in:
parent
41a0e95d61
commit
ca0633c808
6 changed files with 106 additions and 30 deletions
|
@ -70,6 +70,13 @@ fn render(
|
|||
item.set_relevance(CompletionRelevance {
|
||||
type_match: compute_type_match(completion, &ret_type),
|
||||
exact_name_match: compute_exact_name_match(completion, &call),
|
||||
is_op_method: match func_type {
|
||||
FuncType::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_)),
|
||||
_ => false,
|
||||
},
|
||||
..CompletionRelevance::default()
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue