Skip to content

Commit

Permalink
fix: workaround for hover for multi declaraction (Scala 3)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Dec 12, 2024
1 parent 574d599 commit 976955c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,13 @@ object MetalsInteractive:
*/
else if head.isInstanceOf[TypeTree] then
enclosingSymbolsWithExpressionType(tail, pos, indexed)
else Nil
else
path match
case (_: ValDef) :: (t : Template) :: _ =>
t.body.collectFirst {
case d: ValDef if d.nameSpan.contains(pos.span) => List((d.symbol, d.symbol.info))
}.getOrElse(Nil)
case _ => Nil
else
val recovered = recoverError(head, indexed)
if recovered.isEmpty then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ class HoverTermSuite extends BaseHoverSuite {
)

check(
"i7012".tag(IgnoreScala3),
"i7012",
"""|object O {
| val x@@x, yy, zz = 1
|}
Expand Down

0 comments on commit 976955c

Please sign in to comment.