diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-18 17:24:48 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-18 17:24:48 +0000 |
commit | 9210f480ac1788aaac18a0a575ee3556e0e5f9e3 (patch) | |
tree | 919ac212ab95d3acf949dbf78b9c5e606f4c321f /crates/ide/src | |
parent | 6105dbfc2ee811f23255e74c45450c50cc155e85 (diff) | |
parent | 22b9b9abe73e57cac300a2c6b493507fc816770a (diff) |
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 <[email protected]>
Diffstat (limited to 'crates/ide/src')
-rw-r--r-- | crates/ide/src/references.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index 51a2f4327..df9c31aef 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs | |||
@@ -930,6 +930,26 @@ impl Foo { | |||
930 | ); | 930 | ); |
931 | } | 931 | } |
932 | 932 | ||
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 | |||
933 | fn check(ra_fixture: &str, expect: Expect) { | 953 | fn check(ra_fixture: &str, expect: Expect) { |
934 | check_with_scope(ra_fixture, None, expect) | 954 | check_with_scope(ra_fixture, None, expect) |
935 | } | 955 | } |