From 72712b8a428e17d63c413522c770e8f1f0587455 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Wed, 20 Feb 2019 22:36:54 +0100 Subject: Fix handling of generics in tuple variants and refactor a bit Also make them display a tiny bit nicer. Fixes #860. --- crates/ra_ide_api/src/hover.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'crates/ra_ide_api/src/hover.rs') diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index 0888ab6de..a41c4e546 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs @@ -163,6 +163,23 @@ mod tests { assert_eq!(hover.info, "u32"); } + #[test] + fn hover_some() { + let (analysis, position) = single_file_with_position( + " + enum Option { Some(T) } + use Option::Some; + + fn main() { + So<|>me(12); + } + ", + ); + let hover = analysis.hover(position).unwrap().unwrap(); + // not the nicest way to show it currently + assert_eq!(hover.info, "Some(T) -> Option"); + } + #[test] fn hover_for_local_variable() { let (analysis, position) = single_file_with_position("fn func(foo: i32) { fo<|>o; }"); -- cgit v1.2.3