scala / scala3

The Scala 3 compiler, also known as Dotty.
https://dotty.epfl.ch
Apache License 2.0
5.79k stars 1.04k forks source link

ScalaDoc - No DRI found for query: Enum when enumeratum is used #20028

Open OndrejSpanel opened 5 months ago

OndrejSpanel commented 5 months ago

Compiler version

3.3.3

Minimized code

package my_package

import enumeratum._

sealed trait SomeEnum extends EnumEntry

case object SomeEnum extends Enum[SomeEnum] {
  val values = findValues

  case object A extends SomeEnum
  case object B extends SomeEnum
}
libraryDependencies += "com.beachape" %% "enumeratum" % "1.7.3"

Use doc in SBT

Output

[warn] -- Warning: src\main\scala\my_package\SomeEnum.scala:8:6 -----------------------
[warn] 8 |  val values = findValues
[warn]   |      ^
[warn]   |      No DRI found for query: Enum

Expectation

No warning. And if there is a warning, it should be actionable. What is DRI? Where was it not found?

Gedochao commented 5 months ago

Minimization could be useful, but I believe the warning message should be improved regardless. @OndrejSpanel would you be able to try to minimize it without the enumeratum dependency?

Meanwhile, DRI seems to be internal doctool terminology and isn't really helpful in user-facing warning. Let's try to purge it from warning/error messages and see if we find out if this warning is even valid.

OndrejSpanel commented 5 months ago

try to minimize it without the enumeratum dependency?

This might be possible, but it would most likely require creating some other macro source instead. The Enum symbol comes somewhere from enumerarum macros.

That said, I have little reason to pursue the issue now, as I decided not to use ScalaDoc for the task I am doing now. I am not sure if/when can I find some time for this.