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.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/ide_completion/src/item.rs b/crates/ide_completion/src/item.rs
index 4a6e034dc9..f2cf577285 100644
--- a/crates/ide_completion/src/item.rs
+++ b/crates/ide_completion/src/item.rs
@@ -139,6 +139,8 @@ pub struct CompletionRelevance {
/// }
/// ```
pub is_local: bool,
+ /// Set for method completions of the `core::ops` family.
+ pub is_op_method: bool,
/// This is set in cases like these:
///
/// ```
@@ -198,6 +200,9 @@ impl CompletionRelevance {
if self.is_local {
score += 1;
}
+ if self.is_op_method {
+ score -= 1;
+ }
if self.exact_postfix_snippet_match {
score += 100;
}
@@ -588,10 +593,8 @@ mod tests {
..CompletionRelevance::default()
}],
vec![CompletionRelevance {
- exact_name_match: false,
- type_match: None,
- is_local: false,
exact_postfix_snippet_match: true,
+ ..CompletionRelevance::default()
}],
];