summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-10-20 20:49:22 +0200
committerStef Walter <stefw@gnome.org>2013-10-28 20:54:37 +0100
commit95cd591fb7e855d280505168444894e729bb39f8 (patch)
treeaeb75506c8455eb02be9d3f80f545606da9ba54b
parent2a569cb68ca4e4ce08ff66fc20a79bc57222c2e2 (diff)
downloadgobject-introspection-95cd591fb7e855d280505168444894e729bb39f8.tar.gz
giscanner: Include field documentation
Structure field documentation was not being included in the gir file. https://bugzilla.gnome.org/show_bug.cgi?id=710562
-rw-r--r--giscanner/maintransformer.py2
-rw-r--r--tests/scanner/Regress-1.0-expected.gir3
2 files changed, 4 insertions, 1 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 08783131..67cbec83 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -743,7 +743,7 @@ class MainTransformer(object):
type_annotation = tag.annotations.get(ANN_TYPE)
if type_annotation:
field.type = self._transformer.create_type_from_user_string(type_annotation[0])
-
+ field.doc = tag.description
try:
self._adjust_container_type(parent, field, tag.annotations)
except AttributeError, ex:
diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir
index 925fe538..a16205bc 100644
--- a/tests/scanner/Regress-1.0-expected.gir
+++ b/tests/scanner/Regress-1.0-expected.gir
@@ -90,14 +90,17 @@ and/or use gtk-doc annotations. -->
<record name="AnnotationFields" c:type="RegressAnnotationFields">
<doc xml:space="preserve">This is a struct for testing field documentation and annotations</doc>
<field name="field1" writable="1">
+ <doc xml:space="preserve">Some documentation</doc>
<type name="gint" c:type="int"/>
</field>
<field name="arr" writable="1">
+ <doc xml:space="preserve">an array of length @len</doc>
<array length="2" zero-terminated="0" c:type="guchar*">
<type name="guint8" c:type="guchar"/>
</array>
</field>
<field name="len" writable="1">
+ <doc xml:space="preserve">the length of array</doc>
<type name="gulong" c:type="gulong"/>
</field>
</record>