diff --git a/compiler/load/src/docs.rs b/compiler/load/src/docs.rs index f5c8bfc6ad..d489bccc7e 100644 --- a/compiler/load/src/docs.rs +++ b/compiler/load/src/docs.rs @@ -111,12 +111,16 @@ fn generate_module_doc<'a>( }, Alias { - name: _, + name, vars: _, ann: _, - } => - // TODO - { + } => { + let entry = DocEntry { + name: name.value.to_string(), + docs: before_comments_or_new_lines.and_then(comments_or_new_lines_to_docs), + }; + acc.push(entry); + (acc, None) } diff --git a/docs/tests/fixtures/Interface.roc b/docs/tests/fixtures/Interface.roc index f03e820518..f9860af81c 100644 --- a/docs/tests/fixtures/Interface.roc +++ b/docs/tests/fixtures/Interface.roc @@ -2,6 +2,9 @@ interface Test exposes [ singleline, multiline, multiparagraph, codeblock ] imports [] +## This is a block +Block : [ @Block ] + ## Single line documentation. singleline : Bool -> Bool diff --git a/docs/tests/test_docs.rs b/docs/tests/test_docs.rs index 1099d88b69..87ba98fd1a 100644 --- a/docs/tests/test_docs.rs +++ b/docs/tests/test_docs.rs @@ -20,6 +20,10 @@ mod test_docs { }; let expected_entries = vec![ + ModuleEntry { + name: "Block".to_string(), + docs: "
This is a block
\n".to_string(), + }, ModuleEntry { name: "singleline".to_string(), docs: "Single line documentation.
\n".to_string(),