Add module documentation support

This commit is contained in:
Jeremy A. Kolb 2019-01-25 12:51:36 -05:00
parent bce0c6267a
commit 6588579116
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 {
parent: VariantDef,