646: Add module documentation support r=matklad a=kjeremy



Co-authored-by: Jeremy A. Kolb <jkolb@ara.com>
This commit is contained in:
bors[bot] 2019-01-25 17:55:29 +00:00
commit cc73d3ccbc
4 changed files with 50 additions and 1 deletions

View file

@ -177,6 +177,13 @@ impl Module {
}
}
impl Docs for Module {
fn docs(&self, db: &impl HirDatabase) -> Option<Documentation> {
self.declaration_source(db)
.and_then(|it| docs_from_ast(&*it.1))
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct StructField {
pub(crate) parent: VariantDef,