From 93e9361280370b1778ceb47eec00e25f19a92928 Mon Sep 17 00:00:00 2001 From: Aire-One Date: Sat, 27 Mar 2021 15:42:20 +0100 Subject: [PATCH] fix(ldoc.ltp): item.inherited can be wrongly false For some reasons, sometime `item.inherited` is `false` even if the item was added to the `all_module_kinds` table by the "hierarchy lookup" for-loop, and we already force the `inherited` property to be sets to `true` at this moment. With this commit, we add a second fail-check condition based on the `item.baseclass` property to determine if the item is inherited or not when we do the render. --- docs/ldoc.ltp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/ldoc.ltp b/docs/ldoc.ltp index 5d3d9a1b..5e7de3d7 100644 --- a/docs/ldoc.ltp +++ b/docs/ldoc.ltp @@ -259,6 +259,7 @@ # end # for item in iter(k.items) do # local dn = display_name(item) +# local inherited = item.inherited or (item.baseclass ~= module.name) # if item.sanitize_type then item.sanitize_type(item, ldoc) end # if item.display_type and not item.compact_signature then @@ -272,8 +273,8 @@ # end # end - $(M(item.summary,item)) -# if item.inherited then + $(M(item.summary,item)) +# if inherited then Inherited from $(item.baseclass) @@ -332,8 +333,8 @@ $(item.display_type) # end -# if item.inherited then - · Inherited from $(item.baseclass) +# if item.inherited or (item.baseclass ~= module.name) then + · Inherited from $(M(item.baseclass, item)) # end # if item.extra_summary then # for _, col in ldoc.ipairs(item.extra_summary) do