bu5hm4n pushed a commit to branch master.

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

commit a152ba6d5b7ed1a8d4c111e2b7d7025a733818a9
Author: Xavi Artigas <[email protected]>
Date:   Tue Feb 19 13:29:09 2019 +0100

    mono-docs: Add <value> tags to properties
    
    eolian_mono now generates properties (which simply wrap the setter and 
getter
    methods when both ara available), but they were missing docs, because
    properties require a special <value> tag instead of <returns> or <param> 
which
    we are already implementing.
    This commit adds <value> tags only if docs can be retrieved from the setter 
or
    the getter methods.
---
 src/bin/eolian_mono/eolian/mono/documentation.hh | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh 
b/src/bin/eolian_mono/eolian/mono/documentation.hh
index d2f4669b2c..c00b449365 100644
--- a/src/bin/eolian_mono/eolian/mono/documentation.hh
+++ b/src/bin/eolian_mono/eolian/mono/documentation.hh
@@ -252,6 +252,12 @@ struct documentation_generator
       return generate_tag(sink, "returns", text, context);
    }
 
+   template<typename OutputIterator, typename Context>
+   bool generate_tag_value(OutputIterator sink, std::string const& text, 
Context const& context) const
+   {
+      return generate_tag(sink, "value", text, context);
+   }
+
    // Actual exported generators
    template<typename OutputIterator, typename Attribute, typename Context>
    bool generate(OutputIterator sink, Attribute const& attr, Context const& 
context) const
@@ -259,6 +265,23 @@ struct documentation_generator
        return generate(sink, attr.documentation, context);
    }
 
+   template<typename OutputIterator, typename Context>
+   bool generate(OutputIterator sink, attributes::property_def const& prop, 
Context const& context) const
+   {
+       if (!generate(sink, prop.documentation, context))
+         return false;
+
+       std::string text;
+       if (prop.setter.is_engaged())
+         text = prop.setter->parameters[0].documentation.full_text;
+       else if (prop.getter.is_engaged())
+         text = prop.getter->return_documentation.full_text;
+       // If there are no docs at all, do not generate <value> tag
+       else return true;
+
+       return generate_tag_value(sink, text, context);
+   }
+
    template<typename OutputIterator, typename Context>
    bool generate(OutputIterator sink, attributes::function_def const& func, 
Context const& context) const
    {

-- 


Reply via email to