]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Tidy up appending of colons to gtk-doc comments
authorPhilip Withnall <philip@tecnocode.co.uk>
Tue, 14 Aug 2012 22:06:15 +0000 (00:06 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Tue, 14 Aug 2012 22:53:35 +0000 (00:53 +0200)
gtk-doc prefers to have colons on the first line of every
documentation comment.

src/doclets/gtkdoc/gcomment.vala
src/doclets/gtkdoc/generator.vala

index 99c5f67547bf946c8135ce19391c8499397f9336..4e683cac15debae6ceabe9f7a8e43a3c3f7fb9da 100644 (file)
@@ -53,13 +53,13 @@ public class Gtkdoc.GComment {
        public string[] returns_annotations;
        public Gee.List<Header> versioning = new Gee.LinkedList<Header> ();
        public string[] see_also;
+       public bool is_section;
 
        public string to_string () {
                var builder = new StringBuilder ();
 
-               builder.append_printf ("/**\n * %s", symbol);
+               builder.append_printf ("/**\n * %s", (is_section ? "SECTION:%s" : "%s:").printf (symbol));
                if (symbol_annotations != null && symbol_annotations.length > 0) {
-                       builder.append_c (':');
                        foreach (var annotation in symbol_annotations) {
                                builder.append_printf (" (%s)", annotation);
                        }
index 3bb57fc0570decbb5f677991d4774e5fa4597b35..8c7831f2882bff3eb2edc69916a875439f643105 100644 (file)
@@ -178,7 +178,8 @@ public class Gtkdoc.Generator : Api.Visitor {
                        return;
                }
 
-               var gcomment = create_gcomment ("SECTION:%s".printf (get_section (filename)), comment);
+               var gcomment = create_gcomment (get_section (filename), comment);
+               gcomment.is_section = true;
                gcomment.short_description = true;
                file_data.section_comment = gcomment;
        }