aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_ide/src/hover.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs
index 138a7a7a9..bbff5e81a 100644
--- a/crates/ra_ide/src/hover.rs
+++ b/crates/ra_ide/src/hover.rs
@@ -200,7 +200,16 @@ fn runnable_action(
200 _ => None, 200 _ => None,
201 }, 201 },
202 ModuleDef::Function(it) => { 202 ModuleDef::Function(it) => {
203 runnable(&sema, it.source(sema.db).value.syntax().clone(), file_id) 203 let src = it.source(sema.db);
204 if src.file_id != file_id.into() {
205 // Don't try to find runnables in a macro generated code.
206 // See tests below:
207 // test_hover_macro_generated_struct_fn_doc_comment
208 // test_hover_macro_generated_struct_fn_doc_attr
209 return None;
210 }
211
212 runnable(&sema, src.value.syntax().clone(), file_id)
204 .map(|it| HoverAction::Runnable(it)) 213 .map(|it| HoverAction::Runnable(it))
205 } 214 }
206 _ => None, 215 _ => None,