aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api')
-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 a41c4e546..c62683ad4 100644
--- a/crates/ra_ide_api/src/hover.rs
+++ b/crates/ra_ide_api/src/hover.rs
@@ -240,4 +240,24 @@ mod tests {
240 assert_eq!("usize", &type_name); 240 assert_eq!("usize", &type_name);
241 } 241 }
242 242
243 #[test]
244 fn test_hover_infer_associated_method_result() {
245 let (analysis, position) = single_file_with_position(
246 "
247 struct Thing { x: u32 };
248
249 impl Thing {
250 fn new() -> Thing {
251 Thing { x: 0 }
252 }
253 }
254
255 fn main() {
256 let foo_<|>test = Thing::new();
257 }
258 ",
259 );
260 let hover = analysis.hover(position).unwrap().unwrap();
261 assert_eq!(hover.info, "Thing");
262 }
243} 263}