- graph.add_edge(graph.by_id[parent], "DECLARES", self)
- for c in inner_classes do
- var node = graph.by_id[c].as(ClassCompound)
- graph.add_edge(self, "INTRODUCES", node)
- graph.add_edge(self, "DEFINES", node.class_def)
+ var ns_compound = namespace.seek_in(graph)
+ var self_class = ns_compound.self_class
+ var class_count = 0
+ var last_class: nullable ClassCompound = null
+
+ graph.add_edge(ns_compound, "DECLARES", self)
+
+ for c in file_compound.inner_classes do
+ if graph.class_to_ns[c] != ns_compound then continue
+ var class_compound = graph.by_id[c].as(ClassCompound)
+ last_class = class_compound
+ class_count += 1
+ graph.add_edge(self, "INTRODUCES", class_compound)
+ graph.add_edge(self, "DEFINES", class_compound.class_def)
+ end
+
+ if self_class isa SelfClass then
+ # We assume that only one file is linked to the namespace.
+ # TODO When Doxygen will provide a way to know which file defines which member, use it.
+ self_class.location = file_compound.location
+ graph.add_edge(self, "INTRODUCES", self_class)
+ graph.add_edge(self, "DEFINES", self_class.class_def)
+ end
+
+ if doc.is_empty and class_count == 1 then
+ doc = last_class.as(not null).doc