From cbc49659027dbb2f2abcb184a5f66dc534145be0 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 26 Jul 2020 11:51:54 +0200 Subject: [PATCH] Show definition for type defs As in the previous commit, we have to use the selector "pre.typedef" instead of ".docblock.type-decl" to select the definition for type defs. --- CHANGELOG.md | 2 +- src/parser.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01ca2fd..c14ccfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ SPDX-License-Identifier: MIT - Improve the documentation parser: - Fix the definition of methods to only contain the actual definition. - Remove spurious members in module documentation. - - Show the definition for constants. + - Show the definition for constants and typedefs. ## v0.1.2 (2020-07-25) diff --git a/src/parser.rs b/src/parser.rs index 3f23780..7e8ee03 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -132,6 +132,7 @@ pub fn parse_item_doc(item: &doc::Item) -> anyhow::Result { let definition_selector = match item.ty { doc::ItemType::Constant => "pre.const", doc::ItemType::Function => "pre.fn", + doc::ItemType::Typedef => "pre.typedef", _ => ".docblock.type-decl", }; let definition = select_first(&document, definition_selector)?;