From 6e2e60cbc9226dd3f43cf2b83ff6f5a0cf39e639 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 7 Dec 2019 21:55:02 +0100 Subject: Discover type parameters in more cases --- crates/ra_hir/src/from_source.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/from_source.rs b/crates/ra_hir/src/from_source.rs index 68e59fc1e..4acc038e4 100644 --- a/crates/ra_hir/src/from_source.rs +++ b/crates/ra_hir/src/from_source.rs @@ -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, } }; -- cgit v1.2.3