mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 05:53:45 +00:00
Merge #7329
7329: Add test for reference search on self declaration param r=Veykril a=Veykril Closes #7316 bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
commit
9210f480ac
1 changed files with 20 additions and 0 deletions
|
@ -930,6 +930,26 @@ impl Foo {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_find_self_refs_decl() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
struct Foo { bar: i32 }
|
||||||
|
|
||||||
|
impl Foo {
|
||||||
|
fn foo(self$0) {
|
||||||
|
self;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
expect![[r#"
|
||||||
|
self SelfParam FileId(0) 47..51 47..51 SelfParam
|
||||||
|
|
||||||
|
FileId(0) 63..67 Other Read
|
||||||
|
"#]],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
fn check(ra_fixture: &str, expect: Expect) {
|
fn check(ra_fixture: &str, expect: Expect) {
|
||||||
check_with_scope(ra_fixture, None, expect)
|
check_with_scope(ra_fixture, None, expect)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue