+ # inherited mproperties
+ var inhs = new ArrayMap[MClass, Array[MProperty]]
+ var ancestors = mclass.in_hierarchy(mainmodule).greaters.to_a
+ mainmodule.linearize_mclasses(ancestors)
+ for a in ancestors do
+ if a == mclass then continue
+ for c in a.mclassdefs do
+ for p in c.intro_mproperties do
+ if p.intro_mclassdef == c then
+ if not inhs.has_key(a) then inhs[a] = new Array[MProperty]
+ inhs[a].add(p)
+ end
+ end
+ end
+ end
+ if not inhs.is_empty then
+ pager.add("# inherited properties".bold)
+ for a, ps in inhs do
+ pager.add("\n\tfrom {a.namespace.bold}: {ps.join(", ")}")
+ end
+ end
+ end
+ pager.render
+ end
+
+ private fun mpropdef_fulldoc(pager: Pager, mpropdef: MPropDef) do
+ if mbuilder.mpropdef2npropdef.has_key(mpropdef) then
+ var nprop = mbuilder.mpropdef2npropdef[mpropdef]
+ if not nprop.n_doc == null and not nprop.n_doc.comment.is_empty then
+ for comment in nprop.n_doc.comment do pager.add("\t{comment.green}")
+ end
+ end
+ pager.add("\t{mpropdef}")
+ if not mpropdef.is_intro then
+ pager.add("\t\t" + "introduced in {mpropdef.mproperty.intro_mclassdef.namespace.bold}".gray)
+ end
+ var mpropdefs = mpropdef.mproperty.mpropdefs
+ mainmodule.linearize_mpropdefs(mpropdefs)
+ for mpdef in mpropdefs do
+ if not mpdef.is_intro then
+ pager.add("\t\t" + "refined in {mpdef.mclassdef.namespace.bold}".gray)
+ end
+ end
+ end
+
+ private fun props_fulldoc(raw_mprops: List[MProperty]) do
+ var pager = new Pager
+ # group by module
+ var cats = new HashMap[MClass, Array[MProperty]]
+ for mprop in raw_mprops do
+ if not mbuilder.mpropdef2npropdef.has_key(mprop.intro) then continue
+ if mprop isa MAttribute then continue
+ var mclass = mprop.intro_mclassdef.mclass
+ if not cats.has_key(mclass) then cats[mclass] = new Array[MProperty]
+ cats[mclass].add(mprop)
+ end
+ #sort groups
+ var sorter = new MClassNameSorter
+ var sorted = new Array[MClass]
+ sorted.add_all(cats.keys)
+ sorter.sort(sorted)
+ # display
+ for mclass in sorted do
+ var mprops = cats[mclass]
+ pager.add("# {mclass.namespace}".bold)
+ var sorterp = new MPropertyNameSorter
+ sorterp.sort(mprops)
+ for mprop in mprops do
+ pager.add("")
+ mpropdef_fulldoc(pager, mprop.intro)
+ end
+ pager.add_rule