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)

Property definitions

nitc :: term_model $ MEntity :: cs_declaration
	# 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