aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/goto_type_definition.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/goto_type_definition.rs')
-rw-r--r--crates/ra_ide/src/goto_type_definition.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/crates/ra_ide/src/goto_type_definition.rs b/crates/ra_ide/src/goto_type_definition.rs
index cc1b90925..5501bb742 100644
--- a/crates/ra_ide/src/goto_type_definition.rs
+++ b/crates/ra_ide/src/goto_type_definition.rs
@@ -104,7 +104,7 @@ mod tests {
104 } 104 }
105 105
106 #[test] 106 #[test]
107 fn goto_type_definition_works_param() { 107 fn goto_type_definition_for_param() {
108 check_goto( 108 check_goto(
109 " 109 "
110 //- /lib.rs 110 //- /lib.rs
@@ -114,4 +114,20 @@ mod tests {
114 "Foo STRUCT_DEF FileId(1) [0; 11) [7; 10)", 114 "Foo STRUCT_DEF FileId(1) [0; 11) [7; 10)",
115 ); 115 );
116 } 116 }
117
118 #[test]
119 fn goto_type_definition_for_tuple_field() {
120 check_goto(
121 "
122 //- /lib.rs
123 struct Foo;
124 struct Bar(Foo);
125 fn foo() {
126 let bar = Bar(Foo);
127 bar.<|>0;
128 }
129 ",
130 "Foo STRUCT_DEF FileId(1) [0; 11) [7; 10)",
131 );
132 }
117} 133}