Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_completion/src/item.rs')
-rw-r--r--crates/ide_completion/src/item.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ide_completion/src/item.rs b/crates/ide_completion/src/item.rs
index 8c73bcaab2..2fa8f77264 100644
--- a/crates/ide_completion/src/item.rs
+++ b/crates/ide_completion/src/item.rs
@@ -132,6 +132,8 @@ pub struct CompletionRelevance {
/// }
/// ```
pub is_local: bool,
+ /// This is set when trait items are completed in an impl of that trait.
+ pub is_item_from_trait: bool,
/// Set for method completions of the `core::ops` and `core::cmp` family.
pub is_op_method: bool,
/// Set for item completions that are private but in the workspace.
@@ -197,6 +199,7 @@ impl CompletionRelevance {
exact_name_match,
type_match,
is_local,
+ is_item_from_trait,
is_op_method,
is_private_editable,
postfix_match,
@@ -228,6 +231,9 @@ impl CompletionRelevance {
if is_local {
score += 1;
}
+ if is_item_from_trait {
+ score += 1;
+ }
if is_definite {
score += 10;
}