Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/completions/item_list/trait_impl.rs')
-rw-r--r--crates/ide-completion/src/completions/item_list/trait_impl.rs41
1 files changed, 18 insertions, 23 deletions
diff --git a/crates/ide-completion/src/completions/item_list/trait_impl.rs b/crates/ide-completion/src/completions/item_list/trait_impl.rs
index 80d72b460f..6d1945c453 100644
--- a/crates/ide-completion/src/completions/item_list/trait_impl.rs
+++ b/crates/ide-completion/src/completions/item_list/trait_impl.rs
@@ -514,18 +514,13 @@ fn function_declaration(
#[cfg(test)]
mod tests {
- use expect_test::{expect, Expect};
+ use expect_test::expect;
- use crate::tests::{check_edit, completion_list_no_kw};
-
- fn check(ra_fixture: &str, expect: Expect) {
- let actual = completion_list_no_kw(ra_fixture);
- expect.assert_eq(&actual)
- }
+ use crate::tests::{check_edit, check_no_kw};
#[test]
fn no_completion_inside_fn() {
- check(
+ check_no_kw(
r"
trait Test { fn test(); fn test2(); }
struct T;
@@ -544,7 +539,7 @@ impl Test for T {
"#]],
);
- check(
+ check_no_kw(
r"
trait Test { fn test(); fn test2(); }
struct T;
@@ -558,7 +553,7 @@ impl Test for T {
expect![[""]],
);
- check(
+ check_no_kw(
r"
trait Test { fn test(); fn test2(); }
struct T;
@@ -573,7 +568,7 @@ impl Test for T {
);
// https://github.com/rust-lang/rust-analyzer/pull/5976#issuecomment-692332191
- check(
+ check_no_kw(
r"
trait Test { fn test(); fn test2(); }
struct T;
@@ -587,7 +582,7 @@ impl Test for T {
expect![[r#""#]],
);
- check(
+ check_no_kw(
r"
trait Test { fn test(_: i32); fn test2(); }
struct T;
@@ -606,7 +601,7 @@ impl Test for T {
"#]],
);
- check(
+ check_no_kw(
r"
trait Test { fn test(_: fn()); fn test2(); }
struct T;
@@ -624,7 +619,7 @@ impl Test for T {
#[test]
fn no_completion_inside_const() {
- check(
+ check_no_kw(
r"
trait Test { const TEST: fn(); const TEST2: u32; type Test; fn test(); }
struct T;
@@ -636,7 +631,7 @@ impl Test for T {
expect![[r#""#]],
);
- check(
+ check_no_kw(
r"
trait Test { const TEST: u32; const TEST2: u32; type Test; fn test(); }
struct T;
@@ -653,7 +648,7 @@ impl Test for T {
"#]],
);
- check(
+ check_no_kw(
r"
trait Test { const TEST: u32; const TEST2: u32; type Test; fn test(); }
struct T;
@@ -670,7 +665,7 @@ impl Test for T {
"#]],
);
- check(
+ check_no_kw(
r"
trait Test { const TEST: u32; const TEST2: u32; type Test; fn test(); }
struct T;
@@ -689,7 +684,7 @@ impl Test for T {
"#]],
);
- check(
+ check_no_kw(
r"
trait Test { const TEST: u32; const TEST2: u32; type Test; fn test(); }
struct T;
@@ -703,7 +698,7 @@ impl Test for T {
expect![[""]],
);
- check(
+ check_no_kw(
r"
trait Test { const TEST: u32; const TEST2: u32; type Test; fn test(); }
struct T;
@@ -720,7 +715,7 @@ impl Test for T {
#[test]
fn no_completion_inside_type() {
- check(
+ check_no_kw(
r"
trait Test { type Test; type Test2; fn test(); }
struct T;
@@ -737,7 +732,7 @@ impl Test for T {
"#]],
);
- check(
+ check_no_kw(
r"
trait Test { type Test; type Test2; fn test(); }
struct T;
@@ -1263,7 +1258,7 @@ impl Foo<u32> for Bar {
#[test]
fn works_directly_in_impl() {
- check(
+ check_no_kw(
r#"
trait Tr {
fn required();
@@ -1277,7 +1272,7 @@ impl Tr for () {
fn fn required()
"#]],
);
- check(
+ check_no_kw(
r#"
trait Tr {
fn provided() {}