mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
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>
This commit is contained in:
commit
11f3231a75
1 changed files with 19 additions and 1 deletions
|
@ -101,7 +101,10 @@ fn complete_methods(
|
||||||
mod tests {
|
mod tests {
|
||||||
use expect_test::{expect, Expect};
|
use expect_test::{expect, Expect};
|
||||||
|
|
||||||
use crate::{tests::filtered_completion_list, CompletionKind};
|
use crate::{
|
||||||
|
tests::{check_edit, filtered_completion_list},
|
||||||
|
CompletionKind,
|
||||||
|
};
|
||||||
|
|
||||||
fn check(ra_fixture: &str, expect: Expect) {
|
fn check(ra_fixture: &str, expect: Expect) {
|
||||||
let actual = filtered_completion_list(ra_fixture, CompletionKind::Reference);
|
let actual = filtered_completion_list(ra_fixture, CompletionKind::Reference);
|
||||||
|
@ -253,6 +256,21 @@ fn foo(a: A) { a.$0 }
|
||||||
me the_method() (as Trait) fn(&self)
|
me the_method() (as Trait) fn(&self)
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
|
check_edit(
|
||||||
|
"the_method",
|
||||||
|
r#"
|
||||||
|
struct A {}
|
||||||
|
trait Trait { fn the_method(&self); }
|
||||||
|
impl Trait for A {}
|
||||||
|
fn foo(a: A) { a.$0 }
|
||||||
|
"#,
|
||||||
|
r#"
|
||||||
|
struct A {}
|
||||||
|
trait Trait { fn the_method(&self); }
|
||||||
|
impl Trait for A {}
|
||||||
|
fn foo(a: A) { a.the_method()$0 }
|
||||||
|
"#,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue