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.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}