From 90f6f6080ea5f3f8588ed4a10056820e418e78d0 Mon Sep 17 00:00:00 2001 From: kjeremy Date: Mon, 18 Nov 2019 14:02:02 -0500 Subject: [PATCH] Fix test --- crates/ra_ide_api/src/hover.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index 78210b085fe..787b714b3ad 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs @@ -197,8 +197,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option { if let Some(name_kind) = classify_name(db, token.with_ast(&name)).map(|d| d.kind) { - let mut _b: bool = true; - res.extend(hover_text_from_name_kind(db, name_kind, &mut _b)); + res.extend(hover_text_from_name_kind(db, name_kind, &mut true)); } if !res.is_empty() { @@ -721,23 +720,20 @@ fn test_hover_tuple_field() { #[test] fn test_hover_through_macro() { - let (analysis, position) = single_file_with_position( + check_hover_result( " + //- /lib.rs macro_rules! id { - ($($tt:$tt)*) => { $($tt)* } + ($($tt:tt)*) => { $($tt)* } } - fn foo() {} - id! { fn bar() { - foo<|>(); + fo<|>o(); } } ", + &["fn foo()"], ); - let hover = analysis.hover(position).unwrap().unwrap(); - assert_eq!(trim_markup_opt(hover.info.first()), Some("fn foo()")); - assert_eq!(hover.info.is_exact(), true); } }