Is your feature request related to a problem? Please describe.
I have been using a pattern of re-using type names, and relying on package structure and qualified type references to distinguish them.
For example:
//repro.errors.scala
package com.repro.errors
case class A()
//repro.requests.scala
package com.repro.requests
case class A()
//repro.scala
package com.repro
object Main {
case class A()
val request = requests.A()
val error = errors.A()
val local = A()
}
Yields (in scala 3.1.1, vscode metals v1.13.0):
Describe the solution you'd like
It would be nice if the inferred type hint had some disambiguation. Type on hover is more clear, for example:
Describe alternatives you've considered
Currently, you can get kind of disambiguated by exploiting how path dependent types are rendered:
//repro2.scala
package com.repro
object responses extends ResponsesT
trait ResponsesT {
case class A()
}
object Main {
case class A()
val request = requests.A()
val error = errors.A()
val local = A()
val response = responses.A()
}
yields:
But bending code like this for the sake of this quirk seems not worth it.
Is your feature request related to a problem? Please describe.
I have been using a pattern of re-using type names, and relying on package structure and qualified type references to distinguish them.
For example:
Yields (in scala
3.1.1
, vscode metalsv1.13.0
):Describe the solution you'd like
It would be nice if the inferred type hint had some disambiguation. Type on hover is more clear, for example:
Describe alternatives you've considered
Currently, you can get kind of disambiguated by exploiting how path dependent types are rendered:
yields:
But bending code like this for the sake of this quirk seems not worth it.
Additional contex
Discussion in chat: https://discord.com/channels/632642981228314653/632652693013528589/961380730934525974
Search terms
Hints