diff options
author | Lukas Wirth <[email protected]> | 2021-06-09 23:25:36 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-06-09 23:26:15 +0100 |
commit | 26c869ddc0cefc81899dceafb2bf14c66e1c5c54 (patch) | |
tree | ee7763b81fe271c5af29f30b8c274a719527d316 /crates/ide | |
parent | c6133fe51c2cf31d776f16d520de4f78c709181c (diff) |
Don't classify attributes on macro-calls are the macro itself
Diffstat (limited to 'crates/ide')
-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 ae492a264..f8b64a669 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs | |||
@@ -1380,4 +1380,24 @@ lib::foo!(); | |||
1380 | "#]], | 1380 | "#]], |
1381 | ); | 1381 | ); |
1382 | } | 1382 | } |
1383 | |||
1384 | #[test] | ||
1385 | fn macro_doesnt_reference_attribute_on_call() { | ||
1386 | check( | ||
1387 | r#" | ||
1388 | macro_rules! m { | ||
1389 | () => {}; | ||
1390 | } | ||
1391 | |||
1392 | #[proc_macro_test::attr_noop] | ||
1393 | m$0!(); | ||
1394 | |||
1395 | "#, | ||
1396 | expect![[r#" | ||
1397 | m Macro FileId(0) 0..32 13..14 | ||
1398 | |||
1399 | FileId(0) 64..65 | ||
1400 | "#]], | ||
1401 | ); | ||
1402 | } | ||
1383 | } | 1403 | } |