nitc :: MEntity :: cs_declaration
package foo
group foo
module foo
private abstract class Foo[E: Object]
redef class Foo[E]
private fun foo(e: Object): Int
redef fun foo(e)
# Returns the complete MEntity declaration (modifiers + name + signature).
#
# * MPackage: `package foo`
# * MGroup: `group foo`
# * MModule: `module foo`
# * MClass: `private abstract class Foo[E: Object]`
# * MClassDef: `redef class Foo[E]`
# * MProperty: `private fun foo(e: Object): Int`
# * MPropdef: `redef fun foo(e)`
fun cs_declaration(no_color: nullable Bool): String do
var tpl = new FlatBuffer
tpl.append collect_modifiers.join(" ")
tpl.append " "
tpl.append name
tpl.append cs_signature(no_color)
if no_color == null or not no_color then
return tpl.write_to_string.bold
end
return tpl.write_to_string
end
src/doc/templates/term_model.nit:88,2--107,4