diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-19 01:33:49 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-19 01:33:49 +0000 |
commit | 00680a5d7c8f9ab41009d9925cb4c223a86a7615 (patch) | |
tree | a857e7b44a051ce217166de5243d44492ad6d05a /crates/completion/src/completions | |
parent | 5231f4b27098d3eee621d2b781a92c6f3e9f267b (diff) | |
parent | ca6548827634155f28e75bc6cb2e734d2d5d1e95 (diff) |
Merge #7342
7342: Show deprecated completions for deprecated traits r=kjeremy a=SomeoneToIgnore
TIL that there are two kinds of deprecation tags and a few details about String methods.
<img width="472" alt="Screenshot 2021-01-19 at 01 11 38" src="https://user-images.githubusercontent.com/2690773/104970200-569d3380-59f3-11eb-9ee3-627b3c8a5c9d.png">
Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'crates/completion/src/completions')
-rw-r--r-- | crates/completion/src/completions/flyimport.rs | 12 |
1 files changed, 7 insertions, 5 deletions
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 @@ | |||
48 | //! Note that having this flag set to `true` does not guarantee that the feature is enabled: your client needs to have the corredponding | 48 | //! Note that having this flag set to `true` does not guarantee that the feature is enabled: your client needs to have the corredponding |
49 | //! capability enabled. | 49 | //! capability enabled. |
50 | 50 | ||
51 | use hir::{ModPath, ScopeDef}; | 51 | use hir::{AsAssocItem, ModPath, ScopeDef}; |
52 | use ide_db::helpers::{ | 52 | use ide_db::helpers::{ |
53 | import_assets::{ImportAssets, ImportCandidate}, | 53 | import_assets::{ImportAssets, ImportCandidate}, |
54 | insert_use::ImportScope, | 54 | insert_use::ImportScope, |
@@ -601,11 +601,12 @@ fn main() { | |||
601 | } | 601 | } |
602 | 602 | ||
603 | #[test] | 603 | #[test] |
604 | fn zero_input_assoc_item_completion() { | 604 | fn zero_input_deprecated_assoc_item_completion() { |
605 | check( | 605 | check( |
606 | r#" | 606 | r#" |
607 | //- /lib.rs crate:dep | 607 | //- /lib.rs crate:dep |
608 | pub mod test_mod { | 608 | pub mod test_mod { |
609 | #[deprecated] | ||
609 | pub trait TestTrait { | 610 | pub trait TestTrait { |
610 | const SPECIAL_CONST: u8; | 611 | const SPECIAL_CONST: u8; |
611 | type HumbleType; | 612 | type HumbleType; |
@@ -628,7 +629,7 @@ fn main() { | |||
628 | } | 629 | } |
629 | "#, | 630 | "#, |
630 | expect![[r#" | 631 | expect![[r#" |
631 | me random_method() (dep::test_mod::TestTrait) fn random_method(&self) | 632 | me random_method() (dep::test_mod::TestTrait) fn random_method(&self) DEPRECATED |
632 | "#]], | 633 | "#]], |
633 | ); | 634 | ); |
634 | 635 | ||
@@ -636,6 +637,7 @@ fn main() { | |||
636 | r#" | 637 | r#" |
637 | //- /lib.rs crate:dep | 638 | //- /lib.rs crate:dep |
638 | pub mod test_mod { | 639 | pub mod test_mod { |
640 | #[deprecated] | ||
639 | pub trait TestTrait { | 641 | pub trait TestTrait { |
640 | const SPECIAL_CONST: u8; | 642 | const SPECIAL_CONST: u8; |
641 | type HumbleType; | 643 | type HumbleType; |
@@ -657,8 +659,8 @@ fn main() { | |||
657 | } | 659 | } |
658 | "#, | 660 | "#, |
659 | expect![[r#" | 661 | expect![[r#" |
660 | ct SPECIAL_CONST (dep::test_mod::TestTrait) | 662 | ct SPECIAL_CONST (dep::test_mod::TestTrait) DEPRECATED |
661 | fn weird_function() (dep::test_mod::TestTrait) fn weird_function() | 663 | fn weird_function() (dep::test_mod::TestTrait) fn weird_function() DEPRECATED |
662 | "#]], | 664 | "#]], |
663 | ); | 665 | ); |
664 | } | 666 | } |