File tree Expand file tree Collapse file tree 2 files changed +20
-7
lines changed
test/dotty/tools/pc/tests/hover Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -216,13 +216,6 @@ object MetalsInteractive:
216216 if head.symbol.is(Exported ) then
217217 val sym = head.symbol.sourceSymbol
218218 List ((sym, sym.info, None ))
219- else if head.symbol.is(Synthetic ) then
220- enclosingSymbolsWithExpressionType(
221- tail,
222- pos,
223- indexed,
224- skipCheckOnName
225- )
226219 else if head.symbol != NoSymbol then
227220 if skipCheckOnName ||
228221 MetalsInteractive .isOnName(
@@ -231,6 +224,13 @@ object MetalsInteractive:
231224 indexed.ctx.source
232225 )
233226 then List ((head.symbol, head.typeOpt, None ))
227+ else if head.symbol.is(Synthetic ) then
228+ enclosingSymbolsWithExpressionType(
229+ tail,
230+ pos,
231+ indexed,
232+ skipCheckOnName
233+ )
234234 /* Type tree for List(1) has an Int type variable, which has span
235235 * but doesn't exist in code.
236236 * https://github.com/lampepfl/dotty/issues/15937
Original file line number Diff line number Diff line change @@ -718,3 +718,16 @@ class HoverTermSuite extends BaseHoverSuite:
718718 """ def ???: Nothing""" .stripMargin.hover
719719 )
720720
721+ @ Test def `value-of` : Unit =
722+ check(
723+ """ |enum Foo(val key: String) {
724+ | case Bar extends Foo("b")
725+ | case Baz extends Foo("z")
726+ |}
727+ |
728+ |object Foo {
729+ | def parse(key: String) = Foo.va@@lueOf("b")
730+ |
731+ |""" .stripMargin,
732+ " def valueOf($name: String): Foo" .hover
733+ )
You can’t perform that action at this time.
0 commit comments