diff options
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r-- | crates/ra_ide_api/src/hover.rs | 16 |
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 | } |