aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists
diff options
context:
space:
mode:
authorIgor Matuszewski <[email protected]>2019-03-06 13:41:22 +0000
committerIgor Matuszewski <[email protected]>2019-03-16 21:41:13 +0000
commitfc060573f9374af3b3a44343d303ef6e26f116a8 (patch)
tree7a51f61eaacbd60d6a12ff0c8abbf5812f89479c /crates/ra_assists
parent9a59272f5f3efd502f666c78ce901fff8db0dfba (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.rs41
-rw-r--r--crates/ra_assists/src/lib.rs2
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 @@
1use crate::assist_ctx::{Assist, AssistCtx};
2use hir::db::HirDatabase;
3
4pub(crate) fn add_missing_impl_members(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> {
5 unimplemented!()
6}
7
8#[cfg(test)]
9mod 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 "
18trait Foo {
19 fn foo(&self);
20}
21
22struct S;
23
24impl Foo for S {
25 <|>
26}",
27 "
28trait Foo {
29 fn foo(&self);
30}
31
32struct S;
33
34impl 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;
95mod split_import; 95mod split_import;
96mod remove_dbg; 96mod remove_dbg;
97mod auto_import; 97mod auto_import;
98mod add_missing_impl_members;
98 99
99fn all_assists<DB: HirDatabase>() -> &'static [fn(AssistCtx<DB>) -> Option<Assist>] { 100fn 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