All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ammonite.interp.script.DummyBuildServerImplems.scala Maven / Gradle / Ivy

There is a newer version: 3.0.0-M0-67-83057fea
Show newest version
package ammonite.interp.script

import java.util.concurrent.CompletableFuture
import ch.epfl.scala.bsp4j._
import scala.collection.JavaConverters._

private[script] trait DummyBuildServerImplems extends BuildServer with ScalaBuildServer {

  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] = {
    val result = new RunResult(StatusCode.ERROR)
    result.setOriginId(params.getOriginId)
    CompletableFuture.completedFuture(result)
  }
  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(
    params: ScalaMainClassesParams
  ): CompletableFuture[ScalaMainClassesResult] = {
    val items = params.getTargets.asScala.map { target =>
      new ScalaMainClassesItem(target, List.empty[ScalaMainClass].asJava)
    }
    val result = new ScalaMainClassesResult(items.asJava)
    CompletableFuture.completedFuture(result)
  }
  def buildTargetScalaTestClasses(
    params: ScalaTestClassesParams
  ): CompletableFuture[ScalaTestClassesResult] = {
    val items = params.getTargets.asScala.map { target =>
      new ScalaTestClassesItem(target, List.empty[String].asJava)
    }
    val result = new ScalaTestClassesResult(items.asJava)
    CompletableFuture.completedFuture(result)
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy