diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_assists/src/add_missing_impl_members.rs | 41 | ||||
-rw-r--r-- | crates/ra_assists/src/lib.rs | 2 |
2 files changed, 43 insertions, 0 deletions
diff --git a/crates/ra_assists/src/add_missing_impl_members.rs b/crates/ra_assists/src/add_missing_impl_members.rs new file mode 100644 index 000000000..a0b656f8f --- /dev/null +++ b/crates/ra_assists/src/add_missing_impl_members.rs | |||
@@ -0,0 +1,41 @@ | |||
1 | use crate::assist_ctx::{Assist, AssistCtx}; | ||
2 | use hir::db::HirDatabase; | ||
3 | |||
4 | pub(crate) fn add_missing_impl_members(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { | ||
5 | unimplemented!() | ||
6 | } | ||
7 | |||
8 | #[cfg(test)] | ||
9 | mod tests { | ||
10 | use super::*; | ||
11 | use crate::helpers::{ check_assist }; | ||
12 | |||
13 | #[test] | ||
14 | fn test_add_missing_impl_members() { | ||
15 | check_assist( | ||
16 | add_missing_impl_members, | ||
17 | " | ||
18 | trait Foo { | ||
19 | fn foo(&self); | ||
20 | } | ||
21 | |||
22 | struct S; | ||
23 | |||
24 | impl Foo for S { | ||
25 | <|> | ||
26 | }", | ||
27 | " | ||
28 | trait Foo { | ||
29 | fn foo(&self); | ||
30 | } | ||
31 | |||
32 | struct S; | ||
33 | |||
34 | impl Foo for S { | ||
35 | fn foo(&self) { | ||
36 | <|> | ||
37 | } | ||
38 | }", | ||
39 | ); | ||
40 | } | ||
41 | } | ||
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index 6c3d75d79..0c4abb450 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs | |||
@@ -95,6 +95,7 @@ mod replace_if_let_with_match; | |||
95 | mod split_import; | 95 | mod split_import; |
96 | mod remove_dbg; | 96 | mod remove_dbg; |
97 | mod auto_import; | 97 | mod auto_import; |
98 | mod add_missing_impl_members; | ||
98 | 99 | ||
99 | fn all_assists<DB: HirDatabase>() -> &'static [fn(AssistCtx<DB>) -> Option<Assist>] { | 100 | fn all_assists<DB: HirDatabase>() -> &'static [fn(AssistCtx<DB>) -> Option<Assist>] { |
100 | &[ | 101 | &[ |
@@ -108,6 +109,7 @@ fn all_assists<DB: HirDatabase>() -> &'static [fn(AssistCtx<DB>) -> Option<Assis | |||
108 | split_import::split_import, | 109 | split_import::split_import, |
109 | remove_dbg::remove_dbg, | 110 | remove_dbg::remove_dbg, |
110 | auto_import::auto_import, | 111 | auto_import::auto_import, |
112 | add_missing_impl_members::add_missing_impl_members, | ||
111 | ] | 113 | ] |
112 | } | 114 | } |
113 | 115 | ||