mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Support runnables in macros
This commit is contained in:
parent
fea81d4e52
commit
8b03b58ad7
2 changed files with 136 additions and 73 deletions
|
@ -183,12 +183,7 @@ fn runnable_action(
|
|||
) -> Option<HoverAction> {
|
||||
match def {
|
||||
Definition::ModuleDef(it) => match it {
|
||||
ModuleDef::Module(it) => match it.definition_source(sema.db).value {
|
||||
ModuleSource::Module(it) => {
|
||||
runnable_mod(&sema, it).map(|it| HoverAction::Runnable(it))
|
||||
}
|
||||
_ => None,
|
||||
},
|
||||
ModuleDef::Module(it) => runnable_mod(&sema, it).map(|it| HoverAction::Runnable(it)),
|
||||
ModuleDef::Function(func) => {
|
||||
let src = func.source(sema.db)?;
|
||||
if src.file_id != file_id.into() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue