We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3434f1d commit 46084f8Copy full SHA for 46084f8
crates/ra_ide/src/hover.rs
@@ -200,7 +200,16 @@ fn runnable_action(
200
_ => None,
201
},
202
ModuleDef::Function(it) => {
203
- runnable(&sema, it.source(sema.db).value.syntax().clone(), file_id)
+ 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)
213
.map(|it| HoverAction::Runnable(it))
214
}
215
0 commit comments