Skip to content

Commit

Permalink
Backport Updates to 2.x (#1371)
Browse files Browse the repository at this point in the history
Backports of #1358 and #1368 into 2.x branch (cherry-picked and solved a
conflict)

Pull request: #1371
  • Loading branch information
fabianhjr-dealengine authored Sep 16, 2023
1 parent 159ff8f commit 6321610
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ class AmmoniteBuildServer(
clientOpt = Some(client)
}


def buildInitialize(params: InitializeBuildParams): CompletableFuture[InitializeBuildResult] =
nonBlocking {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,33 @@ import ch.epfl.scala.bsp4j._
import scala.collection.JavaConverters._

private[script] trait DummyBuildServerImplems extends BuildServer with ScalaBuildServer {
override def buildTargetDependencyModules(dmp: DependencyModulesParams): CompletableFuture[DependencyModulesResult] =
CompletableFuture.completedFuture(new DependencyModulesResult(List.empty.asJava))

def buildTargetResources(params: ResourcesParams): CompletableFuture[ResourcesResult] = {
override def buildTargetOutputPaths(opp: OutputPathsParams): CompletableFuture[OutputPathsResult] =
CompletableFuture.completedFuture(new OutputPathsResult(List.empty.asJava))

override def buildTargetResources(params: ResourcesParams): CompletableFuture[ResourcesResult] = {
val items = params.getTargets.asScala.toList.map { target =>
new ResourcesItem(target, List.empty[String].asJava)
}
val result = new ResourcesResult(items.asJava)
CompletableFuture.completedFuture(result)
}

def buildTargetRun(params: RunParams): CompletableFuture[RunResult] = {
override def buildTargetRun(params: RunParams): CompletableFuture[RunResult] = {
val result = new RunResult(StatusCode.ERROR)
result.setOriginId(params.getOriginId)
CompletableFuture.completedFuture(result)
}
def buildTargetTest(params: TestParams): CompletableFuture[TestResult] = {

override def buildTargetTest(params: TestParams): CompletableFuture[TestResult] = {
val result = new TestResult(StatusCode.ERROR)
result.setOriginId(params.getOriginId)
CompletableFuture.completedFuture(result)
}
def onBuildExit(): Unit = ()
def onBuildInitialized(): Unit = ()

def buildTargetScalaMainClasses(
override def buildTargetScalaMainClasses(
params: ScalaMainClassesParams
): CompletableFuture[ScalaMainClassesResult] = {
val items = params.getTargets.asScala.map { target =>
Expand All @@ -36,7 +40,8 @@ private[script] trait DummyBuildServerImplems extends BuildServer with ScalaBuil
val result = new ScalaMainClassesResult(items.asJava)
CompletableFuture.completedFuture(result)
}
def buildTargetScalaTestClasses(

override def buildTargetScalaTestClasses(
params: ScalaTestClassesParams
): CompletableFuture[ScalaTestClassesResult] = {
val items = params.getTargets.asScala.map { target =>
Expand All @@ -46,4 +51,12 @@ private[script] trait DummyBuildServerImplems extends BuildServer with ScalaBuil
CompletableFuture.completedFuture(result)
}

override def debugSessionStart(dsp: DebugSessionParams): CompletableFuture[DebugSessionAddress] =
CompletableFuture.completedFuture(new DebugSessionAddress(""))

override def onBuildExit(): Unit = ()
override def onBuildInitialized(): Unit = ()

override def workspaceReload(): CompletableFuture[Object] =
CompletableFuture.completedFuture(new {})
}
4 changes: 2 additions & 2 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ val (buildVersion, unstable) = scala.util.Try(
case Some(tagName) => (tagName, false)
}

val bspVersion = "2.0.0-M6"
val bspVersion = "2.1.0-M5"
val fastparseVersion = "2.3.0"
val scalametaVersion = "4.7.8"
val scalametaVersion = "4.8.5"

object Deps {
val acyclic = ivy"com.lihaoyi:::acyclic:0.3.8"
Expand Down

0 comments on commit 6321610

Please sign in to comment.