nitc :: MEntity :: write_extra_doc
stream
# Extra auto documentation to append to the `stream`
private fun write_extra_doc(model: Model, mainmodule: MModule, stream: Writer) do end
src/doc/vim_autocomplete.nit:98,2--99,86
redef fun write_extra_doc(model, mainmodule, stream)
do
# Introduced classes
var class_intros = collect_intro_mclasses.to_a
if class_intros.not_empty then
alpha_comparator.sort class_intros
stream.write line_separator*2
stream.write "## Introduced classes"
for c in class_intros do
stream.write line_separator
stream.write "* {c.name}"
var doc = c.intro.mdoc
if doc != null then stream.write ": {doc.content.first}"
end
end
# Introduced properties
var prop_intros = new Array[MPropDef]
for c in mclassdefs do
prop_intros.add_all c.collect_intro_mpropdefs
end
if prop_intros.not_empty then
alpha_comparator.sort prop_intros
stream.write line_separator*2
stream.write "## Introduced properties"
stream.write line_separator
for p in prop_intros do
p.mproperty.write_synopsis(mainmodule, stream)
end
end
end
src/doc/vim_autocomplete.nit:334,2--367,4
redef fun write_extra_doc(model, mainmodule, stream)
do
# Super classes
stream.write line_separator*2
stream.write "## Class hierarchy"
var direct_supers = [for s in mclass.in_hierarchy(mainmodule).direct_greaters do s.name]
if not direct_supers.is_empty then
alpha_comparator.sort direct_supers
stream.write line_separator
stream.write "* Direct super classes: "
stream.write direct_supers.join(", ")
end
var supers = [for s in mclass.in_hierarchy(mainmodule).greaters do s.name]
supers.remove mclass.name
if not supers.is_empty then
alpha_comparator.sort supers
stream.write line_separator
stream.write "* All super classes: "
stream.write supers.join(", ")
end
var direct_subs = [for s in mclass.in_hierarchy(mainmodule).direct_smallers do s.name]
if not direct_subs.is_empty then
alpha_comparator.sort direct_subs
stream.write line_separator
stream.write "* Direct sub classes: "
stream.write direct_subs.join(", ")
end
var subs = [for s in mclass.in_hierarchy(mainmodule).smallers do s.name]
subs.remove mclass.name
if not subs.is_empty then
alpha_comparator.sort subs
stream.write line_separator
stream.write "* All sub classes: "
stream.write subs.join(", ")
end
# List other properties
stream.write line_separator*2
stream.write "## Properties"
stream.write line_separator
var props = mclass.collect_accessible_mproperties(mainmodule).to_a
alpha_comparator.sort props
for prop in props do
if mclass.name == "Object" or prop.intro.mclassdef.mclass.name != "Object" then
prop.write_synopsis(mainmodule, stream)
end
end
end
src/doc/vim_autocomplete.nit:189,2--240,4