diff options
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/goto_definition.rs | 19 |
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 | } |