Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
OndrejSpanel opened this issue Mar 27, 2024 · 4 comments
Open

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

OndrejSpanel opened this issue Mar 27, 2024 · 4 comments
Labels
area:doctool area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug stat:needs minimization Needs a self contained minimization

Comments

@OndrejSpanel
Copy link
Member

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?

@OndrejSpanel OndrejSpanel added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 27, 2024
@Gedochao Gedochao added area:doctool area:reporting Error reporting including formatting, implicit suggestions, etc stat:needs minimization Needs a self contained minimization and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 2, 2024
@Gedochao
Copy link
Contributor

Gedochao commented Apr 2, 2024

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
Copy link
Member Author

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.

@rjolly
Copy link
Contributor

rjolly commented Jan 10, 2025

The meaning is that Enum is not known in the scaladoc comment below, not sure if/how it can be fixed on the library side:

https://github.com/lloydmeta/enumeratum/blob/master/enumeratum-core/src/main/scala-3/enumeratum/EnumCompat.scala

  /** The sequence of values for your [[Enum]]. You will typically want to implement this in your
    * extending class as a `val` so that `withName` and friends are as efficient as possible.
    *
    * Feel free to implement this however you'd like (including messing around with ordering, etc)
    * if that fits your needs better.
    */
  def values: IndexedSeq[A]

@joroKr21
Copy link
Member

The meaning is that Enum is not known in the scaladoc comment below, not sure if/how it can be fixed on the library side:

Does using a fully-qualified reference help?

Florian3k pushed a commit that referenced this issue Jan 31, 2025
tgodzik pushed a commit to scala/scala3-lts that referenced this issue Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:doctool area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug stat:needs minimization Needs a self contained minimization
Projects
None yet
Development

No branches or pull requests

6 participants