diff options
Diffstat (limited to 'crates/ide/src/references.rs')
-rw-r--r-- | crates/ide/src/references.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index 55a44ff01..a83b82f1b 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs | |||
@@ -1197,4 +1197,39 @@ impl Foo { | |||
1197 | "#]], | 1197 | "#]], |
1198 | ); | 1198 | ); |
1199 | } | 1199 | } |
1200 | |||
1201 | #[test] | ||
1202 | fn test_attr_differs_from_fn_with_same_name() { | ||
1203 | check( | ||
1204 | r#" | ||
1205 | #[test] | ||
1206 | fn test$0() { | ||
1207 | test(); | ||
1208 | } | ||
1209 | "#, | ||
1210 | expect![[r#" | ||
1211 | test Function FileId(0) 0..33 11..15 | ||
1212 | |||
1213 | FileId(0) 24..28 | ||
1214 | "#]], | ||
1215 | ); | ||
1216 | } | ||
1217 | |||
1218 | #[test] | ||
1219 | fn test_attr_matches_proc_macro_fn() { | ||
1220 | check( | ||
1221 | r#" | ||
1222 | #[proc_macro_attribute] | ||
1223 | fn my_proc_macro() {} | ||
1224 | |||
1225 | #[my_proc_macro$0] | ||
1226 | fn test() {} | ||
1227 | "#, | ||
1228 | expect![[r#" | ||
1229 | my_proc_macro Function FileId(0) 0..45 27..40 | ||
1230 | |||
1231 | FileId(0) 49..62 | ||
1232 | "#]], | ||
1233 | ); | ||
1234 | } | ||
1200 | } | 1235 | } |