aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/hover.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-02-20 21:36:54 +0000
committerFlorian Diebold <[email protected]>2019-02-20 21:48:55 +0000
commit72712b8a428e17d63c413522c770e8f1f0587455 (patch)
tree74455d20e5c1be76b1ecf43e9db448a0cae4bf95 /crates/ra_ide_api/src/hover.rs
parentc84561bb624280b84eb2fe6c6b2a6b9fe3f1dbf7 (diff)
Fix handling of generics in tuple variants and refactor a bit
Also make them display a tiny bit nicer. Fixes #860.
Diffstat (limited to 'crates/ra_ide_api/src/hover.rs')
-rw-r--r--crates/ra_ide_api/src/hover.rs17
1 files changed, 17 insertions, 0 deletions
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
@@ -164,6 +164,23 @@ mod tests {
164 } 164 }
165 165
166 #[test] 166 #[test]
167 fn hover_some() {
168 let (analysis, position) = single_file_with_position(
169 "
170 enum Option<T> { Some(T) }
171 use Option::Some;
172
173 fn main() {
174 So<|>me(12);
175 }
176 ",
177 );
178 let hover = analysis.hover(position).unwrap().unwrap();
179 // not the nicest way to show it currently
180 assert_eq!(hover.info, "Some<i32>(T) -> Option<T>");
181 }
182
183 #[test]
167 fn hover_for_local_variable() { 184 fn hover_for_local_variable() {
168 let (analysis, position) = single_file_with_position("fn func(foo: i32) { fo<|>o; }"); 185 let (analysis, position) = single_file_with_position("fn func(foo: i32) { fo<|>o; }");
169 let hover = analysis.hover(position).unwrap().unwrap(); 186 let hover = analysis.hover(position).unwrap().unwrap();