-
Notifications
You must be signed in to change notification settings - Fork 381
Closed
Labels
Scala 3Generic ticket relating to Scala 3Generic ticket relating to Scala 3presentation-compilerSomething relating to the presentation compilerSomething relating to the presentation compiler
Milestone
Description
Describe the bug
Having a minimal piece of code like this:
import scala.annotation.nowarn
@no@@warn
class Foo
When you attempt to do a hover on @nowarn
you actually get the TypeRef
of Foo
shown instead of the information about @nowarn
.
The tree that is returned here for this pos is:
TypeDef(
name = Foo,
rhs = Template(
constr = DefDef(
name = <init>,
paramss = List(List()),
tpt = TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Unit)],
preRhs = Thicket(trees = List())
),
parentsOrDerived = List(
Apply(
fun = Select(
qualifier = New(
tpt = TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class lang)),class Object)]
),
name = <init>
),
args = List()
)
),
self = ValDef(name = _, tpt = Thicket(trees = List()), preRhs = Thicket(trees = List())),
preBody = List()
)
)
I actually stumbled onto this because of something else (trying to understand when I'd see the Annotated
tree) and then realizing I could never see it when testing with untyped trees or typed ones. Then I looked at how Metals would show this, and it also doesn't show the annotation. Is this actually an updates issue that Annotated
is never in the tree?
Expected behavior
I'd expect that this show the signature and scaladocs for @nowarn
instead of for Foo
.
Operating system
macOS
Editor/Extension
Nvim (nvim-metals)
Version of Metals
0.11.1+47-66ea31ef-SNAPSHOT
Extra context or search terms
No response
Metadata
Metadata
Assignees
Labels
Scala 3Generic ticket relating to Scala 3Generic ticket relating to Scala 3presentation-compilerSomething relating to the presentation compilerSomething relating to the presentation compiler