Move structs to new loc

This commit is contained in:
Aleksey Kladov 2019-12-12 14:58:04 +01:00
parent 63c192b34a
commit f135a8ea55
14 changed files with 66 additions and 30 deletions

View file

@ -23,8 +23,10 @@ pub trait FromSource: Sized {
impl FromSource for Struct {
type Ast = ast::StructDef;
fn from_source(db: &(impl DefDatabase + AstDatabase), src: InFile<Self::Ast>) -> Option<Self> {
let id = from_source(db, src)?;
Some(Struct { id })
analyze_container(db, src.as_ref().map(|it| it.syntax()))[keys::STRUCT]
.get(&src)
.copied()
.map(Struct::from)
}
}
impl FromSource for Union {