File tree 2 files changed +21
-7
lines changed
test/dotty/tools/pc/tests/hover
2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -230,13 +230,6 @@ object MetalsInteractive:
230
230
if head.symbol.is(Exported ) then
231
231
val sym = head.symbol.sourceSymbol
232
232
List ((sym, sym.info, None ))
233
- else if head.symbol.is(Synthetic ) then
234
- enclosingSymbolsWithExpressionType(
235
- tail,
236
- pos,
237
- indexed,
238
- skipCheckOnName
239
- )
240
233
else if head.symbol != NoSymbol then
241
234
if skipCheckOnName ||
242
235
MetalsInteractive .isOnName(
@@ -245,6 +238,13 @@ object MetalsInteractive:
245
238
indexed.ctx.source
246
239
)
247
240
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
+ )
248
248
/* Type tree for List(1) has an Int type variable, which has span
249
249
* but doesn't exist in code.
250
250
* 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:
744
744
|""" .stripMargin,
745
745
" name: String" .hover
746
746
)
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