aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorunexge <[email protected]>2020-06-06 20:16:59 +0100
committerunexge <[email protected]>2020-06-06 20:16:59 +0100
commit73684a4ae2ff5251bbff35109d2c9ad40fe4ef01 (patch)
treebbb971cae2c8309fd9147192e20d054af12e172a /crates/ra_ide
parentd4a92b4fefecbd63d8c7c82a5553cd209c068144 (diff)
Add goto def for enum variant field
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/goto_definition.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/ra_ide/src/goto_definition.rs b/crates/ra_ide/src/goto_definition.rs
index a6c86e99c..693344c31 100644
--- a/crates/ra_ide/src/goto_definition.rs
+++ b/crates/ra_ide/src/goto_definition.rs
@@ -886,4 +886,23 @@ mod tests {
886 "x", 886 "x",
887 ) 887 )
888 } 888 }
889
890 #[test]
891 fn goto_def_for_enum_variant_field() {
892 check_goto(
893 "
894 //- /lib.rs
895 enum Foo {
896 Bar { x: i32 }
897 }
898 fn baz(foo: Foo) {
899 match foo {
900 Foo::Bar { x<|> } => x
901 };
902 }
903 ",
904 "x RECORD_FIELD_DEF FileId(1) 21..27 21..22",
905 "x: i32|x",
906 );
907 }
889} 908}