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.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ide-completion/src/item.rs b/crates/ide-completion/src/item.rs
index cfadec6287..f54c8dd8b0 100644
--- a/crates/ide-completion/src/item.rs
+++ b/crates/ide-completion/src/item.rs
@@ -181,6 +181,9 @@ pub struct CompletionRelevance {
/// }
/// ```
pub is_local: bool,
+ /// This is missing variant in the patterns.
+ /// Maybe this can also be used for struct fields.
+ pub is_missing: bool,
/// Populated when the completion item comes from a trait (impl).
pub trait_: Option<CompletionRelevanceTraitInfo>,
/// This is set when an import is suggested in a use item whose name is already imported.
@@ -286,6 +289,7 @@ impl CompletionRelevance {
exact_name_match,
type_match,
is_local,
+ is_missing,
is_name_already_imported,
requires_import,
is_private_editable,
@@ -306,6 +310,9 @@ impl CompletionRelevance {
if is_local {
score += 1;
}
+ if is_missing {
+ score += 1;
+ }
// lower rank private things
if !is_private_editable {