Add 'add_missing_impl_members' assist stub

This commit is contained in:
Igor Matuszewski 2019-03-06 14:41:22 +01:00
parent 9a59272f5f
commit fc060573f9
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,41 @@
use crate::assist_ctx::{Assist, AssistCtx};
use hir::db::HirDatabase;
pub(crate) fn add_missing_impl_members(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> {
unimplemented!()
}
#[cfg(test)]
mod tests {
use super::*;
use crate::helpers::{ check_assist };
#[test]
fn test_add_missing_impl_members() {
check_assist(
add_missing_impl_members,
"
trait Foo {
fn foo(&self);
}
struct S;
impl Foo for S {
<|>
}",
"
trait Foo {
fn foo(&self);
}
struct S;
impl Foo for S {
fn foo(&self) {
<|>
}
}",
);
}
}

View File

@ -95,6 +95,7 @@ mod replace_if_let_with_match;
mod split_import;
mod remove_dbg;
mod auto_import;
mod add_missing_impl_members;
fn all_assists<DB: HirDatabase>() -> &'static [fn(AssistCtx<DB>) -> Option<Assist>] {
&[
@ -108,6 +109,7 @@ fn all_assists<DB: HirDatabase>() -> &'static [fn(AssistCtx<DB>) -> Option<Assis
split_import::split_import,
remove_dbg::remove_dbg,
auto_import::auto_import,
add_missing_impl_members::add_missing_impl_members,
]
}