2

I have two methods on my companion object (model.Product):

def apply(p:ProductSyntax)(rs: WrappedResultSet): Product
def apply(p: ResultName[Product])(rs: WrappedResultSet): Product

The first method delegates to the second and I would like to indicate this in the docs. I tried using:

/**
 * delegates to [[apply]]
 * /

But scaladoc complains that this is ambiguous but tells me that

(p: scalikejdbc.ResultName[model.Product])(rs: scalikejdbc.WrappedResultSet): model.Product in object Product

is an option

However I can't work out how to tell scaladoc to use this method. I tried

/**
 * Delegates to [[apply(scalikejdbc.ResultName[model.Product])(scalikejdbc.WrappedResultSet):model.Product]]
 * /

But it tells me that no member is found:

Could not find any member to link for "apply(scalikejdbc.ResultName[model.Product])(scalikejdbc.WrappedResultSet):model.Product".

How would I add a link to the def apply(p: ResultName[Product])(rs: WrappedResultSet): Product method?

  • try to escape the dots: `[[apply(p:scalikejdbc\.ResultName[model\.Product])(rs:scalikejdbc\.WrappedResultSet):model\.Product$]]`. In general everything that is not a member of your object needs to fully qualified and you need a $ at the end to mark the end of the signature. – Sascha Kolberg Mar 23 '16 at 20:13
  • Sadly I get the same error: Could not find any member to link for "apply(p:scalikejdbc\.ResultName[model\.Product])(rs:scalikejdbc\.WrappedResul‌​tSet):model\.Product$". –  Mar 23 '16 at 20:54

1 Answers1

4

So this is what I discovered:

  1. Everything must be fully qualified, even the class/object itself

  2. Package dots should be escaped with \

  3. You cannot use any spaces in the signature

  4. Paramaters should include the name not just the type i.e. foo(a:String) not foo(String)

  5. The signature should end with a *

Finally this worked:

[[apply(p:scalikejdbc\.ResultName[model\.Product])(rs:scalikejdbc\.WrappedResultSet):model\.Product*]]

HOWEVER ... the backslash escaping and * also appears in the generated html!

Generated html for the scaladoc

  • ah, I suspected you need to add the object. However, you can beautify the link by specifying a label after the signature separated by a space like: `[[apply(p:scalikejdbc\.ResultName[model\.Product])(rs:scalikejdbc\.WrappedResultSet):model\.Product* apply(ResultName[Product]):Product]]`. Though, you may have to escape stuff there, too. – Sascha Kolberg Mar 25 '16 at 11:56
  • 10
    I'd like to express my utter disappointment with Scaladoc. This sort of thing eschews good documentation. – Peter L Oct 26 '16 at 00:36
  • not even these rules worked when trying to link to another class like `[[amf\.client\.remod\.AMFResult*]]` – Ariel Mirra May 11 '21 at 19:52