xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3b9f8f8d6aab609ad6411d1b489a217b66293492

commit 3b9f8f8d6aab609ad6411d1b489a217b66293492
Author: Xavi Artigas <[email protected]>
Date:   Fri Dec 21 15:21:46 2018 +0100

    efl-mono: Use alternate docs when a property has no doc
    
    Summary:
    Use the getter or the setter documentation when a property has no 
documentation.
    This is not ideal (all properties should have documentation!) but at least 
we
    have less undocumented properties.
    See for example Efl.Canvas.Vg.Above.
    
    Test Plan:
    The Efl.Canvas.Vg.Above property in 
src/lib/evas/canvas/efl_canvas_vg_node.eo.cs
    was previously undocumented because that property (inherited from 
Efl.Gfx.Stack)
    has no docs, only its getter has docs.
    
    Reviewers: lauromoura
    
    Reviewed By: lauromoura
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D7500
---
 src/lib/eolian_cxx/grammar/klass_def.hpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp 
b/src/lib/eolian_cxx/grammar/klass_def.hpp
index 008b5aa0e6..23303a0202 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -843,7 +843,15 @@ struct property_def
 
     Eolian_Function_Type type = ::eolian_function_type_get(function);
     if (type == EOLIAN_PROP_GET || type == EOLIAN_PROP_SET || type == 
EOLIAN_PROPERTY)
-      documentation = eolian_implement_documentation_get(implement, 
EOLIAN_PROPERTY);
+      {
+         documentation = eolian_implement_documentation_get(implement, 
EOLIAN_PROPERTY);
+         // If property-level documentation is empty, use the getter- or 
setter-level
+         // docs as fallback (if present).
+         if (documentation.summary.empty())
+           documentation = eolian_implement_documentation_get(implement, 
EOLIAN_PROP_GET);
+         if (documentation.summary.empty())
+           documentation = eolian_implement_documentation_get(implement, 
EOLIAN_PROP_SET);
+      }
   }
 };
 

-- 


Reply via email to