Skip to content

Commit 174b497

Browse files
kasiaMarektgodzik
authored andcommitted
adjust for Java 8 and fix doc test
[Cherry-picked d1a150a]
1 parent 0a6b8a4 commit 174b497

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

presentation-compiler/src/main/dotty/tools/pc/ScalaPresentationCompiler.scala

+7-8
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,14 @@ case class ScalaPresentationCompiler(
9898
params match {
9999
case range: RangeParams =>
100100
extractMethod(range, extractionPos)
101-
case _ =>
102-
CompletableFuture.failedFuture(
103-
new IllegalArgumentException(s"Expected range parameters")
104-
)
101+
case _ => failedFuture(new IllegalArgumentException(s"Expected range parameters"))
105102
}
106-
case (id, _) =>
107-
CompletableFuture.failedFuture(
108-
new IllegalArgumentException(s"Unsupported action id $id")
109-
)
103+
case (id, _) => failedFuture(new IllegalArgumentException(s"Unsupported action id $id"))
104+
105+
private def failedFuture[T](e: Throwable): CompletableFuture[T] =
106+
val f = new CompletableFuture[T]()
107+
f.completeExceptionally(e)
108+
f
110109

111110
override def withCompletionItemPriority(
112111
priority: CompletionItemPriority

presentation-compiler/test/dotty/tools/pc/tests/hover/HoverNamedArgSuite.scala

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class HoverNamedArgSuite extends BaseHoverSuite:
2929
"""|```scala
3030
|named: Int
3131
|```
32-
|Found documentation for a/b.foo().(named)
3332
|""".stripMargin
3433
)
3534

0 commit comments

Comments
 (0)