Unnamed repository; edit this file 'description' to name the repository.
| -rw-r--r-- | crates/ide-completion/src/item.rs | 7 | ||||
| -rw-r--r-- | crates/ide-completion/src/render.rs | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/crates/ide-completion/src/item.rs b/crates/ide-completion/src/item.rs index da0bdcff01..a138273e7f 100644 --- a/crates/ide-completion/src/item.rs +++ b/crates/ide-completion/src/item.rs @@ -286,7 +286,7 @@ impl CompletionRelevance { function, is_skipping_completion, has_local_inherent_impl, - is_deprecated: _, + is_deprecated, } = self; // only applicable for completions within use items @@ -363,6 +363,11 @@ impl CompletionRelevance { score -= 5; } + // lower rank for deprecated items + if is_deprecated { + score -= 5; + } + score } diff --git a/crates/ide-completion/src/render.rs b/crates/ide-completion/src/render.rs index 9eaa63040a..608dec1285 100644 --- a/crates/ide-completion/src/render.rs +++ b/crates/ide-completion/src/render.rs @@ -3802,10 +3802,10 @@ fn main() { } "#, expect![[r#" - ct INFINITY f32 [type_could_unify+requires_import+deprecated] - ct NEG_INFINITY f32 [type_could_unify+requires_import+deprecated] ct INFINITY pub const INFINITY: f32 [] ct NEG_INFINITY pub const NEG_INFINITY: f32 [] + ct INFINITY f32 [type_could_unify+requires_import+deprecated] + ct NEG_INFINITY f32 [type_could_unify+requires_import+deprecated] "#]], ); } |