Support runnables in macros

This commit is contained in:
Edwin Cheng 2021-01-19 16:58:11 +08:00
parent fea81d4e52
commit 8b03b58ad7
2 changed files with 136 additions and 73 deletions

View file

@ -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() {