diff options
author | Igor Matuszewski <[email protected]> | 2019-03-06 13:41:22 +0000 |
---|---|---|
committer | Igor Matuszewski <[email protected]> | 2019-03-16 21:41:13 +0000 |
commit | fc060573f9374af3b3a44343d303ef6e26f116a8 (patch) | |
tree | 7a51f61eaacbd60d6a12ff0c8abbf5812f89479c /crates/ra_assists | |
parent | 9a59272f5f3efd502f666c78ce901fff8db0dfba (diff) |
Add 'add_missing_impl_members' assist stub
Diffstat (limited to 'crates/ra_assists')
-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 | ||