From a0fb06eef9663644fbe33ff076de0a27d7f6a49e Mon Sep 17 00:00:00 2001 From: Alex Kladov Date: Tue, 16 Apr 2024 16:31:29 +0100 Subject: [PATCH] add new test --- crates/ide/src/references.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index 8eb4bfe6d0d9..01af864cdf57 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs @@ -350,6 +350,27 @@ fn test() { ); } + #[test] + fn test_access() { + check( + r#" +struct S { f$0: u32 } + +#[test] +fn test() { + let mut x = S { f: 92 }; + x.f = 92; +} +"#, + expect![[r#" + f Field FileId(0) 11..17 11..12 + + FileId(0) 61..62 read test + FileId(0) 76..77 write test + "#]], + ); + } + #[test] fn test_struct_literal_after_space() { check(