diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-09 11:15:20 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-09 11:15:20 +0100 |
commit | 7566d7da8ab035a286f82a60b8e2c679158bc56c (patch) | |
tree | d7330bf7d50a78f86339c91168ca53379e689dcf /crates/ra_ide/src/completion | |
parent | 91005ecc27427f46529b9372f91e5072dfe5e179 (diff) | |
parent | 4399eff2d06f9134ff37a4dfd47204de6ebebd92 (diff) |
Merge #5280
5280: Re-enable IDE features for incomplete impl blocs r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/completion')
-rw-r--r-- | crates/ra_ide/src/completion/complete_unqualified_path.rs | 17 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/completion_item.rs | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/crates/ra_ide/src/completion/complete_unqualified_path.rs b/crates/ra_ide/src/completion/complete_unqualified_path.rs index 72ff82e66..18f4488b7 100644 --- a/crates/ra_ide/src/completion/complete_unqualified_path.rs +++ b/crates/ra_ide/src/completion/complete_unqualified_path.rs | |||
@@ -638,4 +638,21 @@ fn f() {} | |||
638 | expect![[""]], | 638 | expect![[""]], |
639 | ) | 639 | ) |
640 | } | 640 | } |
641 | |||
642 | #[test] | ||
643 | fn completes_type_or_trait_in_impl_block() { | ||
644 | check( | ||
645 | r#" | ||
646 | trait MyTrait {} | ||
647 | struct MyStruct {} | ||
648 | |||
649 | impl My<|> | ||
650 | "#, | ||
651 | expect![[r#" | ||
652 | st MyStruct | ||
653 | tt MyTrait | ||
654 | tp Self | ||
655 | "#]], | ||
656 | ) | ||
657 | } | ||
641 | } | 658 | } |
diff --git a/crates/ra_ide/src/completion/completion_item.rs b/crates/ra_ide/src/completion/completion_item.rs index d7011c9cf..7bdda316c 100644 --- a/crates/ra_ide/src/completion/completion_item.rs +++ b/crates/ra_ide/src/completion/completion_item.rs | |||
@@ -58,7 +58,7 @@ pub struct CompletionItem { | |||
58 | score: Option<CompletionScore>, | 58 | score: Option<CompletionScore>, |
59 | } | 59 | } |
60 | 60 | ||
61 | // We use custom debug for CompletionItem to make `insta`'s diffs more readable. | 61 | // We use custom debug for CompletionItem to make snapshot tests more readable. |
62 | impl fmt::Debug for CompletionItem { | 62 | impl fmt::Debug for CompletionItem { |
63 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | 63 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
64 | let mut s = f.debug_struct("CompletionItem"); | 64 | let mut s = f.debug_struct("CompletionItem"); |