aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/hover.rs
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2019-03-06 16:39:11 +0000
committerkjeremy <[email protected]>2019-03-06 16:39:11 +0000
commitaac421b1351d6c6dddb37a92a33d929b79ed1d70 (patch)
tree72dd9a37f8da8bdd98a4e4dce47cff85883cd2d4 /crates/ra_ide_api/src/hover.rs
parentb1a1d20e067c25fb80fbab43b2956b6747a8dd3c (diff)
Hover for associated items in patterns
Diffstat (limited to 'crates/ra_ide_api/src/hover.rs')
-rw-r--r--crates/ra_ide_api/src/hover.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs
index bcd052c8b..638c24e31 100644
--- a/crates/ra_ide_api/src/hover.rs
+++ b/crates/ra_ide_api/src/hover.rs
@@ -534,4 +534,27 @@ mod tests {
534 assert_eq!(trim_markup_opt(hover.info.first()), Some("fn new() -> Thing")); 534 assert_eq!(trim_markup_opt(hover.info.first()), Some("fn new() -> Thing"));
535 assert_eq!(hover.info.is_exact(), true); 535 assert_eq!(hover.info.is_exact(), true);
536 } 536 }
537
538 #[test]
539 fn test_hover_infer_associated_const_in_pattern() {
540 let (analysis, position) = single_file_with_position(
541 "
542 struct X;
543 impl X {
544 const C: u32 = 1;
545 }
546
547 fn main() {
548 match 1 {
549 X::C<|> => {},
550 2 => {},
551 _ => {}
552 };
553 }
554 ",
555 );
556 let hover = analysis.hover(position).unwrap().unwrap();
557 assert_eq!(trim_markup_opt(hover.info.first()), Some("const C: u32"));
558 assert_eq!(hover.info.is_exact(), true);
559 }
537} 560}