Discover type parameters in more cases

This commit is contained in:
Aleksey Kladov 2019-12-07 21:55:02 +01:00
parent 971df306ad
commit 6e2e60cbc9

View file

@ -184,6 +184,11 @@ impl TypeParam {
let res = match_ast! { let res = match_ast! {
match it { match it {
ast::FnDef(value) => { Function::from_source(db, InFile { value, file_id})?.id.into() }, ast::FnDef(value) => { Function::from_source(db, InFile { value, file_id})?.id.into() },
ast::StructDef(value) => { Struct::from_source(db, InFile { value, file_id})?.id.into() },
ast::EnumDef(value) => { Enum::from_source(db, InFile { value, file_id})?.id.into() },
ast::TraitDef(value) => { Trait::from_source(db, InFile { value, file_id})?.id.into() },
ast::TypeAliasDef(value) => { TypeAlias::from_source(db, InFile { value, file_id})?.id.into() },
ast::ImplBlock(value) => { ImplBlock::from_source(db, InFile { value, file_id})?.id.into() },
_ => return None, _ => return None,
} }
}; };