Skip to content

Commit 9210f48

Browse files
bors[bot]Veykril
andauthored
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>
2 parents 6105dbf + 22b9b9a commit 9210f48

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

crates/ide/src/references.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,26 @@ impl Foo {
930930
);
931931
}
932932

933+
#[test]
934+
fn test_find_self_refs_decl() {
935+
check(
936+
r#"
937+
struct Foo { bar: i32 }
938+
939+
impl Foo {
940+
fn foo(self$0) {
941+
self;
942+
}
943+
}
944+
"#,
945+
expect![[r#"
946+
self SelfParam FileId(0) 47..51 47..51 SelfParam
947+
948+
FileId(0) 63..67 Other Read
949+
"#]],
950+
);
951+
}
952+
933953
fn check(ra_fixture: &str, expect: Expect) {
934954
check_with_scope(ra_fixture, None, expect)
935955
}

0 commit comments

Comments
 (0)