mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Discover type parameters in more cases
This commit is contained in:
parent
971df306ad
commit
6e2e60cbc9
1 changed files with 5 additions and 0 deletions
|
@ -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,
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue