Skip to content

Commit 11f3231

Browse files
bors[bot]Veykril
andauthored
Merge #9524
9524: minor: Add test for trait completion label edit r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 parents 9912b07 + 2e8f3fe commit 11f3231

File tree

1 file changed

+19
-1
lines changed
  • crates/ide_completion/src/completions

1 file changed

+19
-1
lines changed

crates/ide_completion/src/completions/dot.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ fn complete_methods(
101101
mod tests {
102102
use expect_test::{expect, Expect};
103103

104-
use crate::{tests::filtered_completion_list, CompletionKind};
104+
use crate::{
105+
tests::{check_edit, filtered_completion_list},
106+
CompletionKind,
107+
};
105108

106109
fn check(ra_fixture: &str, expect: Expect) {
107110
let actual = filtered_completion_list(ra_fixture, CompletionKind::Reference);
@@ -253,6 +256,21 @@ fn foo(a: A) { a.$0 }
253256
me the_method() (as Trait) fn(&self)
254257
"#]],
255258
);
259+
check_edit(
260+
"the_method",
261+
r#"
262+
struct A {}
263+
trait Trait { fn the_method(&self); }
264+
impl Trait for A {}
265+
fn foo(a: A) { a.$0 }
266+
"#,
267+
r#"
268+
struct A {}
269+
trait Trait { fn the_method(&self); }
270+
impl Trait for A {}
271+
fn foo(a: A) { a.the_method()$0 }
272+
"#,
273+
);
256274
}
257275

258276
#[test]

0 commit comments

Comments
 (0)