2495: Discover type parameters in more cases r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2019-12-07 20:55:29 +00:00 committed by GitHub
commit 9e551d5452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -184,6 +184,11 @@ impl TypeParam {
let res = match_ast! {
match it {
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,
}
};