aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-04-10 22:12:02 +0100
committerJonas Schievink <[email protected]>2021-04-11 00:25:50 +0100
commite2c1da36f59cd99d4da4c1d5f8f323626d3dbe61 (patch)
treee06290db93699c71d1e4c752de6563ff787bd5fa /crates/ide
parentbd675c8a8bdd3fda239bee3d3f31acd8679655b9 (diff)
Support macros in pattern position
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}