Search code examples
scalascaladocscala-3

Cannot add package description in ScalaDoc (Scala 3)


I cannot add a package description in ScalaDoc with Scala 3

/** package description */
package foo {
    /** some scaladoc comment */
    def method():A = ???
}

Then I generate the doc with sbt (1.5.3)

sbt> doc

I don't get the description of the package itself in the index.html file, but only the description of the method inside the package.


Solution

  • I finally found the answer

    Scaladoc comments can go before fields, methods, classes, traits, objects. For now, scaladoc doesn't support straightforward solution to document packages. There is a dedicated github issue, where you can check the current status of the problem.

    https://github.com/lampepfl/dotty/issues/11284