From 65885791165c42b48fa2deaed32c4f35c17c62f5 Mon Sep 17 00:00:00 2001 From: "Jeremy A. Kolb" Date: Fri, 25 Jan 2019 12:51:36 -0500 Subject: Add module documentation support --- crates/ra_hir/src/code_model_api.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 118562984..5a05b5822 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs @@ -177,6 +177,13 @@ impl Module { } } +impl Docs for Module { + fn docs(&self, db: &impl HirDatabase) -> Option { + self.declaration_source(db) + .and_then(|it| docs_from_ast(&*it.1)) + } +} + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct StructField { parent: VariantDef, -- cgit v1.2.3