aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src
diff options
context:
space:
mode:
authorvsrs <[email protected]>2020-06-08 11:56:31 +0100
committervsrs <[email protected]>2020-06-08 12:19:40 +0100
commitb7db9f058ad51b7ba47db02b581a76b6756d74e8 (patch)
tree414a4bdea9d429df53648fcd5e6d0002d9c0d8fd /crates/ra_ide/src
parent9b4256dc4d9e0b633b73f5c07e6e0721bc1e9108 (diff)
Apply suggestions from code review
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r--crates/ra_ide/src/hover.rs12
1 files changed, 8 insertions, 4 deletions
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::{
17 runnables::runnable, 17 runnables::runnable,
18 FileId, FilePosition, NavigationTarget, RangeInfo, Runnable, 18 FileId, FilePosition, NavigationTarget, RangeInfo, Runnable,
19}; 19};
20use test_utils::mark;
20 21
21#[derive(Clone, Debug, PartialEq, Eq)] 22#[derive(Clone, Debug, PartialEq, Eq)]
22pub struct HoverConfig { 23pub struct HoverConfig {
@@ -202,10 +203,9 @@ fn runnable_action(
202 ModuleDef::Function(it) => { 203 ModuleDef::Function(it) => {
203 let src = it.source(sema.db); 204 let src = it.source(sema.db);
204 if src.file_id != file_id.into() { 205 if src.file_id != file_id.into() {
205 // Don't try to find runnables in a macro generated code. 206 mark::hit!(hover_macro_generated_struct_fn_doc_comment);
206 // See tests below: 207 mark::hit!(hover_macro_generated_struct_fn_doc_attr);
207 // test_hover_macro_generated_struct_fn_doc_comment 208
208 // test_hover_macro_generated_struct_fn_doc_attr
209 return None; 209 return None;
210 } 210 }
211 211
@@ -1121,6 +1121,8 @@ fn func(foo: i32) { if true { <|>foo; }; }
1121 1121
1122 #[test] 1122 #[test]
1123 fn test_hover_macro_generated_struct_fn_doc_comment() { 1123 fn test_hover_macro_generated_struct_fn_doc_comment() {
1124 mark::check!(hover_macro_generated_struct_fn_doc_comment);
1125
1124 check_hover_result( 1126 check_hover_result(
1125 r#" 1127 r#"
1126 //- /lib.rs 1128 //- /lib.rs
@@ -1147,6 +1149,8 @@ fn func(foo: i32) { if true { <|>foo; }; }
1147 1149
1148 #[test] 1150 #[test]
1149 fn test_hover_macro_generated_struct_fn_doc_attr() { 1151 fn test_hover_macro_generated_struct_fn_doc_attr() {
1152 mark::check!(hover_macro_generated_struct_fn_doc_attr);
1153
1150 check_hover_result( 1154 check_hover_result(
1151 r#" 1155 r#"
1152 //- /lib.rs 1156 //- /lib.rs