File tree Expand file tree Collapse file tree 2 files changed +21
-7
lines changed
test/dotty/tools/pc/tests/hover Expand file tree Collapse file tree 2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -230,13 +230,6 @@ object MetalsInteractive:
230230 if head.symbol.is(Exported ) then
231231 val sym = head.symbol.sourceSymbol
232232 List ((sym, sym.info, None ))
233- else if head.symbol.is(Synthetic ) then
234- enclosingSymbolsWithExpressionType(
235- tail,
236- pos,
237- indexed,
238- skipCheckOnName
239- )
240233 else if head.symbol != NoSymbol then
241234 if skipCheckOnName ||
242235 MetalsInteractive .isOnName(
@@ -245,6 +238,13 @@ object MetalsInteractive:
245238 indexed.ctx.source
246239 )
247240 then List ((head.symbol, head.typeOpt, None ))
241+ else if head.symbol.is(Synthetic ) then
242+ enclosingSymbolsWithExpressionType(
243+ tail,
244+ pos,
245+ indexed,
246+ skipCheckOnName
247+ )
248248 /* Type tree for List(1) has an Int type variable, which has span
249249 * but doesn't exist in code.
250250 * https://github.com/scala/scala3/issues/15937
Original file line number Diff line number Diff line change @@ -744,3 +744,17 @@ class HoverTermSuite extends BaseHoverSuite:
744744 |""" .stripMargin,
745745 " name: String" .hover
746746 )
747+
748+ @ Test def `value-of` : Unit =
749+ check(
750+ """ |enum Foo(val key: String) {
751+ | case Bar extends Foo("b")
752+ | case Baz extends Foo("z")
753+ |}
754+ |
755+ |object Foo {
756+ | def parse(key: String) = Foo.va@@lueOf("b")
757+ |
758+ |""" .stripMargin,
759+ " def valueOf($name: String): Foo" .hover
760+ )
You can’t perform that action at this time.
0 commit comments