Skip to content

Clarify Scaladoc documentation on how to link to stdlib classes #1232

Open
@Duhemm

Description

@Duhemm

Scaladoc is supposed to be able to link to classes of the standard library, as per the documentation (see [https://docs.scala-lang.org/style/scaladoc.html](Scaladoc style guide), section "General Style", 4th bullet:

Create links to referenced Scala Library classes using the square-bracket syntax, e.g. [[scala.Option]]

This doesn't work. I thought at first that the issue came from a problem with the dots that need escaping, or that maybe I needed to disambiguate between term and type, so I tried again with the following source:

package a

/**
 * Hello world,
 * [[scala.Option]]
 * [[scala.Option!]]
 * [[scala.Option$]]
 * [[scala\.Option]]
 * [[scala\.Option!]]
 * [[scala\.Option$]]
 * [[scala\\.Option]]
 * [[scala\\.Option!]]
 * [[scala\\.Option$]]
 */
object Foo

I'd have expected at least one of the links to work, but none of them resolved:

scaladoc ❯ scaladoc Bar.scala                                                 
model contains 3 documentable templates                                       
Bar.scala:3: warning: Could not find any member to link for "scala.Option".   
/**                                                                           
^                                                                             
Bar.scala:3: warning: Could not find any member to link for "scala.Option!".  
/**                                                                           
^                                                                             
Bar.scala:3: warning: Could not find any member to link for "scala.Option$".  
/**                                                                           
^                                                                             
Bar.scala:3: warning: Could not find any member to link for "scala\.Option".  
/**                                                                           
^                                                                             
Bar.scala:3: warning: Could not find any member to link for "scala\.Option!". 
/**                                                                           
^                                                                             
Bar.scala:3: warning: Could not find any member to link for "scala\.Option$". 
/**                                                                           
^                                                                             
Bar.scala:3: warning: Could not find any member to link for "scala\\.Option". 
/**                                                                           
^                                                                             
Bar.scala:3: warning: Could not find any member to link for "scala\\.Option!".
/**                                                                           
^                                                                             
Bar.scala:3: warning: Could not find any member to link for "scala\\.Option$".
/**                                                                           
^                                                                             
9 warnings found                                                              

Does this feature actually exist?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions