aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide')
-rw-r--r--crates/ide/src/goto_definition.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs
index ca8ccb2da..d057d5402 100644
--- a/crates/ide/src/goto_definition.rs
+++ b/crates/ide/src/goto_definition.rs
@@ -1188,4 +1188,30 @@ pub fn gimme() -> theitem::TheItem {
1188"#, 1188"#,
1189 ); 1189 );
1190 } 1190 }
1191
1192 #[test]
1193 fn goto_ident_from_pat_macro() {
1194 check(
1195 r#"
1196macro_rules! pat {
1197 ($name:ident) => { Enum::Variant1($name) }
1198}
1199
1200enum Enum {
1201 Variant1(u8),
1202 Variant2,
1203}
1204
1205fn f(e: Enum) {
1206 match e {
1207 pat!(bind) => {
1208 //^^^^
1209 bind$0
1210 }
1211 Enum::Variant2 => {}
1212 }
1213}
1214"#,
1215 );
1216 }
1191} 1217}