q66 pushed a commit to branch master.

http://git.enlightenment.org/tools/edocgen.git/commit/?id=1c682951148f26079cd98aba8a18d8707035fdc8

commit 1c682951148f26079cd98aba8a18d8707035fdc8
Author: Daniel Kolesa <[email protected]>
Date:   Thu Feb 13 13:50:48 2020 +0100

    avoid putting overridden impls in members category unless necessary
    
    The logic here is that user doesn't really care about whether the
    function is overridden unless there is a custom documentation
    specified for the override, which itself is rare.
---
 docgen/eolian_utils.lua | 21 ++++++++++++++++++++-
 gendoc.lua              |  2 +-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/docgen/eolian_utils.lua b/docgen/eolian_utils.lua
index a67cd1c..37aa645 100644
--- a/docgen/eolian_utils.lua
+++ b/docgen/eolian_utils.lua
@@ -716,11 +716,30 @@ find_callables = function(cl, omeths, events, written, 
no_overrides)
     end
 end
 
+local has_custom_doc = function(impl, cl, no_overrides)
+    -- we don't care, let it pass
+    if not no_overrides then
+        return true
+    end
+    -- defined in this class, always has its own doc
+    if impl:class_get() == cl then
+        return true
+    end
+    -- otherwise check if this has *any* part of doc...
+    if impl:documentation_get(eolian.function_type.PROP_GET) or
+       impl:documentation_get(eolian.function_type.PROP_SET) or
+       impl:documentation_get(eolian.function_type.UNRESOLVED)
+    then
+        return true
+    end
+    return false
+end
+
 M.callables_get = function(cl, no_overrides)
     local written = {}
     local meths, omeths, evs = {}, {}, {}
     for impl in cl:implements_get() do
-        if not no_overrides or impl:class_get() == cl then
+        if has_custom_doc(impl, cl, no_overrides) then
             local ifunc = impl:function_get()
             written[M.obj_id_get(ifunc)] = true
             meths[#meths + 1] = { cl, impl }
diff --git a/gendoc.lua b/gendoc.lua
index e28d130..8f1c011 100644
--- a/gendoc.lua
+++ b/gendoc.lua
@@ -451,7 +451,7 @@ local build_class = function(cl)
         f:write_nl()
     end
 
-    local meths, omeths, ievs = eoutils.callables_get(cl)
+    local meths, omeths, ievs = eoutils.callables_get(cl, true)
 
     f:write_h("Members", 2)
     write_functable(f, cl, meths, true)

-- 


Reply via email to