aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src/handlers/add_missing_impl_members.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-12 18:06:36 +0000
committerGitHub <[email protected]>2020-12-12 18:06:36 +0000
commita15d19619e097b14b670064a4edc054a4251f479 (patch)
tree87f60edd15e470fbc342cef28b0674ba1cf71df9 /crates/assists/src/handlers/add_missing_impl_members.rs
parent10f633283180d513138d0d969eceba96e3ce9f96 (diff)
parent69b78edb5e2a40d8665db713d363bd16c835d6cf (diff)
Merge #6845
6845: Don't HirDisplay unknown types when displaying for source r=Veykril a=Veykril Was wondering why the add missing impl assist didn't do anything here: ![Code_JCA1Qo0V9P](https://user-images.githubusercontent.com/3757771/101990300-7af44a80-3ca6-11eb-8431-e5eb4de4e78c.png) Turns out me forgetting to set the Index::Idx type in the trait causes RA to panic due to it trying to to create an unparsable type in the `make` module. Now we get this instead which imo is definitely better to have. ![Code_MUFPJUCULY](https://user-images.githubusercontent.com/3757771/101990347-c9094e00-3ca6-11eb-9c6a-146bddf64b7c.png) Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/assists/src/handlers/add_missing_impl_members.rs')
-rw-r--r--crates/assists/src/handlers/add_missing_impl_members.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/assists/src/handlers/add_missing_impl_members.rs b/crates/assists/src/handlers/add_missing_impl_members.rs
index bbb71e261..e413505d3 100644
--- a/crates/assists/src/handlers/add_missing_impl_members.rs
+++ b/crates/assists/src/handlers/add_missing_impl_members.rs
@@ -784,4 +784,29 @@ impl Test for () {
784"#, 784"#,
785 ) 785 )
786 } 786 }
787
788 #[test]
789 fn missing_generic_type() {
790 check_assist(
791 add_missing_impl_members,
792 r#"
793trait Foo<BAR> {
794 fn foo(&self, bar: BAR);
795}
796impl Foo for () {
797 <|>
798}
799"#,
800 r#"
801trait Foo<BAR> {
802 fn foo(&self, bar: BAR);
803}
804impl Foo for () {
805 fn foo(&self, bar: BAR) {
806 ${0:todo!()}
807 }
808}
809"#,
810 )
811 }
787} 812}