File tree 2 files changed +20
-7
lines changed
test/dotty/tools/pc/tests/hover
2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -216,13 +216,6 @@ object MetalsInteractive:
216
216
if head.symbol.is(Exported ) then
217
217
val sym = head.symbol.sourceSymbol
218
218
List ((sym, sym.info, None ))
219
- else if head.symbol.is(Synthetic ) then
220
- enclosingSymbolsWithExpressionType(
221
- tail,
222
- pos,
223
- indexed,
224
- skipCheckOnName
225
- )
226
219
else if head.symbol != NoSymbol then
227
220
if skipCheckOnName ||
228
221
MetalsInteractive .isOnName(
@@ -231,6 +224,13 @@ object MetalsInteractive:
231
224
indexed.ctx.source
232
225
)
233
226
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
+ )
234
234
/* Type tree for List(1) has an Int type variable, which has span
235
235
* but doesn't exist in code.
236
236
* 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:
718
718
""" def ???: Nothing""" .stripMargin.hover
719
719
)
720
720
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