Duplicated section names should print a warning
I don't know if the following should be called "sections", but for this bug I'll call them like that. Say you have foo.c
with these; note that the headings are all for the same FooBar
:
/**
* FooBar:
*
* First.
*/
... many lines here ...
/**
* FooBar:
*
* Second.
*/
In this case, the gir ends up with only Second.
; it seems that the second declaration overwrites the first one.
Context for this: I'm converting librsvg's docs to Markdown for gi-docgen, and where they had this at first:
/**
* SECTION: rsvg-handle
* @short_description: Loads SVG data into memory.
*
* Blah blah blah.
*/
... many lines later ...
/**
* RsvgHandle:
*
* A very short description here.
*/
struct _RsvgHandle {
GObject parent;
/*< private >*/
gpointer _abi_padding[16];
};
No problem so far, right? Well, in removing the SECTION:
in the first comment block for markdown-ification, I ended up with these:
/**
* RsvgHandle:
*
* Blah blah blah.
*/
... many lines later ...
/**
* RsvgHandle:
*
* A very short description here.
*/
struct _RsvgHandle {
GObject parent;
/*< private >*/
gpointer _abi_padding[16];
};
I didn't notice the second comment block, the one with "A very short description here", and it ended up overwriting the one with "Blah blah blah", which is the long description I really wanted to appear in the docs.
It would be nice if g-ir-scanner printed a warning in this case about duplicate section names; it would have let me see that something was off.