From ca6548827634155f28e75bc6cb2e734d2d5d1e95 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Tue, 19 Jan 2021 01:08:59 +0200 Subject: Show deprecated completions for deprecated traits --- crates/completion/src/completions/flyimport.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'crates/completion/src/completions') diff --git a/crates/completion/src/completions/flyimport.rs b/crates/completion/src/completions/flyimport.rs index 47e797ac8..dc0b38a16 100644 --- a/crates/completion/src/completions/flyimport.rs +++ b/crates/completion/src/completions/flyimport.rs @@ -48,7 +48,7 @@ //! Note that having this flag set to `true` does not guarantee that the feature is enabled: your client needs to have the corredponding //! capability enabled. -use hir::{ModPath, ScopeDef}; +use hir::{AsAssocItem, ModPath, ScopeDef}; use ide_db::helpers::{ import_assets::{ImportAssets, ImportCandidate}, insert_use::ImportScope, @@ -601,11 +601,12 @@ fn main() { } #[test] - fn zero_input_assoc_item_completion() { + fn zero_input_deprecated_assoc_item_completion() { check( r#" //- /lib.rs crate:dep pub mod test_mod { + #[deprecated] pub trait TestTrait { const SPECIAL_CONST: u8; type HumbleType; @@ -628,7 +629,7 @@ fn main() { } "#, expect![[r#" - me random_method() (dep::test_mod::TestTrait) fn random_method(&self) + me random_method() (dep::test_mod::TestTrait) fn random_method(&self) DEPRECATED "#]], ); @@ -636,6 +637,7 @@ fn main() { r#" //- /lib.rs crate:dep pub mod test_mod { + #[deprecated] pub trait TestTrait { const SPECIAL_CONST: u8; type HumbleType; @@ -657,8 +659,8 @@ fn main() { } "#, expect![[r#" - ct SPECIAL_CONST (dep::test_mod::TestTrait) - fn weird_function() (dep::test_mod::TestTrait) fn weird_function() + ct SPECIAL_CONST (dep::test_mod::TestTrait) DEPRECATED + fn weird_function() (dep::test_mod::TestTrait) fn weird_function() DEPRECATED "#]], ); } -- cgit v1.2.3