From b7db9f058ad51b7ba47db02b581a76b6756d74e8 Mon Sep 17 00:00:00 2001 From: vsrs Date: Mon, 8 Jun 2020 13:56:31 +0300 Subject: Apply suggestions from code review --- crates/ra_ide/src/hover.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide') diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index bbff5e81a..ad78b7671 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -17,6 +17,7 @@ use crate::{ runnables::runnable, FileId, FilePosition, NavigationTarget, RangeInfo, Runnable, }; +use test_utils::mark; #[derive(Clone, Debug, PartialEq, Eq)] pub struct HoverConfig { @@ -202,10 +203,9 @@ fn runnable_action( ModuleDef::Function(it) => { let src = it.source(sema.db); if src.file_id != file_id.into() { - // Don't try to find runnables in a macro generated code. - // See tests below: - // test_hover_macro_generated_struct_fn_doc_comment - // test_hover_macro_generated_struct_fn_doc_attr + mark::hit!(hover_macro_generated_struct_fn_doc_comment); + mark::hit!(hover_macro_generated_struct_fn_doc_attr); + return None; } @@ -1121,6 +1121,8 @@ fn func(foo: i32) { if true { <|>foo; }; } #[test] fn test_hover_macro_generated_struct_fn_doc_comment() { + mark::check!(hover_macro_generated_struct_fn_doc_comment); + check_hover_result( r#" //- /lib.rs @@ -1147,6 +1149,8 @@ fn func(foo: i32) { if true { <|>foo; }; } #[test] fn test_hover_macro_generated_struct_fn_doc_attr() { + mark::check!(hover_macro_generated_struct_fn_doc_attr); + check_hover_result( r#" //- /lib.rs -- cgit v1.2.3