Is is possible to reference function's parameter in the documention text?

1.9k views Asked by At

I woul like to reference method's parameters in the documentation text, but have no idea how to do it.
In .NET world we use tag paramref

Just as an example:

/** Send email with the specified @paramref body to the addesses given in @paramref to.
@param body Just a plain text or teamplate-aware text.*/ 
def SendEmail(body: EmailBody, to: EmailAddress*) = ???

How is it done in Scala?

2

There are 2 answers

2
AudioBubble On BEST ANSWER

You can make reference in Scaladoc similarly to Javadoc. According to the documentation for javadocs:

{@code foo}

and

<code>foo</code>

But XML looks ugly and not readable, prefer to use {@code foo} instead.

1
Prasad Rao On

I think you should find everything you need in https://docs.scala-lang.org/style/scaladoc.html. Do a string search for "param name".