Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,6 @@ object MetalsInteractive:
if head.symbol.is(Exported) then
val sym = head.symbol.sourceSymbol
List((sym, sym.info, None))
else if head.symbol.is(Synthetic) then
enclosingSymbolsWithExpressionType(
tail,
pos,
indexed,
skipCheckOnName
)
else if head.symbol != NoSymbol then
if skipCheckOnName ||
MetalsInteractive.isOnName(
Expand All @@ -245,6 +238,13 @@ object MetalsInteractive:
indexed.ctx.source
)
then List((head.symbol, head.typeOpt, None))
else if head.symbol.is(Synthetic) then
enclosingSymbolsWithExpressionType(
tail,
pos,
indexed,
skipCheckOnName
)
/* Type tree for List(1) has an Int type variable, which has span
* but doesn't exist in code.
* https://github.com/scala/scala3/issues/15937
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -744,3 +744,17 @@ class HoverTermSuite extends BaseHoverSuite:
|""".stripMargin,
"name: String".hover
)

@Test def `value-of`: Unit =
check(
"""|enum Foo(val key: String) {
| case Bar extends Foo("b")
| case Baz extends Foo("z")
|}
|
|object Foo {
| def parse(key: String) = Foo.va@@lueOf("b")
|
|""".stripMargin,
"def valueOf($name: String): Foo".hover
)
Loading