[valadoc] Fix implicit using directives



commit a9cde7c144a5ebfe46d11172419c1c5bcf8d44ac
Author: Didier 'Ptitjes <ptitjes free fr>
Date:   Sun Sep 27 11:22:53 2009 +0200

    Fix implicit using directives

 src/libvaladoc/apitree/apitree.vala |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/libvaladoc/apitree/apitree.vala b/src/libvaladoc/apitree/apitree.vala
index 9df6d5a..9043508 100644
--- a/src/libvaladoc/apitree/apitree.vala
+++ b/src/libvaladoc/apitree/apitree.vala
@@ -383,10 +383,14 @@ public class Valadoc.Tree : Vala.CodeVisitor {
 
 					if (context.profile == Profile.POSIX) {
 						// import the Posix namespace by default (namespace of backend-specific standard library)
-						source_file.add_using_directive (new UsingDirective (new UnresolvedSymbol (null, "Posix", null)));
+						var ns_ref = new UsingDirective (new UnresolvedSymbol (null, "Posix", null));
+						source_file.add_using_directive (ns_ref);
+						context.root.add_using_directive (ns_ref);
 					} else if (context.profile == Profile.GOBJECT) {
 						// import the GLib namespace by default (namespace of backend-specific standard library)
-						source_file.add_using_directive (new UsingDirective (new UnresolvedSymbol (null, "GLib", null)));
+						var ns_ref = new UsingDirective (new UnresolvedSymbol (null, "GLib", null));
+						source_file.add_using_directive (ns_ref);
+						context.root.add_using_directive (ns_ref);
 					}
 
 					context.add_source_file (source_file);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]