mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Disable runnables lookup in macro-generated code.
This commit is contained in:
parent
3434f1dd2c
commit
46084f8a96
1 changed files with 10 additions and 1 deletions
|
@ -200,7 +200,16 @@ fn runnable_action(
|
||||||
_ => None,
|
_ => None,
|
||||||
},
|
},
|
||||||
ModuleDef::Function(it) => {
|
ModuleDef::Function(it) => {
|
||||||
runnable(&sema, it.source(sema.db).value.syntax().clone(), file_id)
|
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
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
|
runnable(&sema, src.value.syntax().clone(), file_id)
|
||||||
.map(|it| HoverAction::Runnable(it))
|
.map(|it| HoverAction::Runnable(it))
|
||||||
}
|
}
|
||||||
_ => None,
|
_ => None,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue