aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/hover.rs
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2019-11-18 19:02:02 +0000
committerkjeremy <[email protected]>2019-11-18 19:20:14 +0000
commit90f6f6080ea5f3f8588ed4a10056820e418e78d0 (patch)
treeee50cb1890e5460b8bac3e8b8fd163fd681dc948 /crates/ra_ide_api/src/hover.rs
parentb2cc593381aa835b708dfc2df05809e7574be0d6 (diff)
Fix test
Diffstat (limited to 'crates/ra_ide_api/src/hover.rs')
-rw-r--r--crates/ra_ide_api/src/hover.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs
index 78210b085..787b714b3 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<RangeIn
197 }, 197 },
198 ast::Name(name) => { 198 ast::Name(name) => {
199 if let Some(name_kind) = classify_name(db, token.with_ast(&name)).map(|d| d.kind) { 199 if let Some(name_kind) = classify_name(db, token.with_ast(&name)).map(|d| d.kind) {
200 let mut _b: bool = true; 200 res.extend(hover_text_from_name_kind(db, name_kind, &mut true));
201 res.extend(hover_text_from_name_kind(db, name_kind, &mut _b));
202 } 201 }
203 202
204 if !res.is_empty() { 203 if !res.is_empty() {
@@ -721,23 +720,20 @@ fn func(foo: i32) { if true { <|>foo; }; }
721 720
722 #[test] 721 #[test]
723 fn test_hover_through_macro() { 722 fn test_hover_through_macro() {
724 let (analysis, position) = single_file_with_position( 723 check_hover_result(
725 " 724 "
725 //- /lib.rs
726 macro_rules! id { 726 macro_rules! id {
727 ($($tt:$tt)*) => { $($tt)* } 727 ($($tt:tt)*) => { $($tt)* }
728 } 728 }
729
730 fn foo() {} 729 fn foo() {}
731
732 id! { 730 id! {
733 fn bar() { 731 fn bar() {
734 foo<|>(); 732 fo<|>o();
735 } 733 }
736 } 734 }
737 ", 735 ",
736 &["fn foo()"],
738 ); 737 );
739 let hover = analysis.hover(position).unwrap().unwrap();
740 assert_eq!(trim_markup_opt(hover.info.first()), Some("fn foo()"));
741 assert_eq!(hover.info.is_exact(), true);
742 } 738 }
743} 739}