aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/hover.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/hover.rs')
-rw-r--r--crates/ra_ide_api/src/hover.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs
index 0888ab6de..38671b394 100644
--- a/crates/ra_ide_api/src/hover.rs
+++ b/crates/ra_ide_api/src/hover.rs
@@ -223,4 +223,24 @@ mod tests {
223 assert_eq!("usize", &type_name); 223 assert_eq!("usize", &type_name);
224 } 224 }
225 225
226 #[test]
227 fn test_hover_infer_associated_method_result() {
228 let (analysis, position) = single_file_with_position(
229 "
230 struct Thing { x: u32 };
231
232 impl Thing {
233 fn new() -> Thing {
234 Thing { x: 0 }
235 }
236 }
237
238 fn main() {
239 let foo_<|>test = Thing::new();
240 }
241 ",
242 );
243 let hover = analysis.hover(position).unwrap().unwrap();
244 assert_eq!(hover.info, "Thing");
245 }
226} 246}