diff --git a/protocol/src/main/contraband-scala/sbt/internal/bsp/ResourcesItem.scala b/protocol/src/main/contraband-scala/sbt/internal/bsp/ResourcesItem.scala new file mode 100644 index 000000000..62ded2c9c --- /dev/null +++ b/protocol/src/main/contraband-scala/sbt/internal/bsp/ResourcesItem.scala @@ -0,0 +1,37 @@ +/** + * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + */ + +// DO NOT EDIT MANUALLY +package sbt.internal.bsp +/** @param resources List of resource files. */ +final class ResourcesItem private ( + val target: sbt.internal.bsp.BuildTargetIdentifier, + val resources: Vector[java.net.URI]) extends Serializable { + + + + override def equals(o: Any): Boolean = this.eq(o.asInstanceOf[AnyRef]) || (o match { + case x: ResourcesItem => (this.target == x.target) && (this.resources == x.resources) + case _ => false + }) + override def hashCode: Int = { + 37 * (37 * (37 * (17 + "sbt.internal.bsp.ResourcesItem".##) + target.##) + resources.##) + } + override def toString: String = { + "ResourcesItem(" + target + ", " + resources + ")" + } + private[this] def copy(target: sbt.internal.bsp.BuildTargetIdentifier = target, resources: Vector[java.net.URI] = resources): ResourcesItem = { + new ResourcesItem(target, resources) + } + def withTarget(target: sbt.internal.bsp.BuildTargetIdentifier): ResourcesItem = { + copy(target = target) + } + def withResources(resources: Vector[java.net.URI]): ResourcesItem = { + copy(resources = resources) + } +} +object ResourcesItem { + + def apply(target: sbt.internal.bsp.BuildTargetIdentifier, resources: Vector[java.net.URI]): ResourcesItem = new ResourcesItem(target, resources) +} diff --git a/protocol/src/main/contraband-scala/sbt/internal/bsp/ResourcesParams.scala b/protocol/src/main/contraband-scala/sbt/internal/bsp/ResourcesParams.scala new file mode 100644 index 000000000..5233135e5 --- /dev/null +++ b/protocol/src/main/contraband-scala/sbt/internal/bsp/ResourcesParams.scala @@ -0,0 +1,32 @@ +/** + * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + */ + +// DO NOT EDIT MANUALLY +package sbt.internal.bsp +final class ResourcesParams private ( + val targets: Vector[sbt.internal.bsp.BuildTargetIdentifier]) extends Serializable { + + + + override def equals(o: Any): Boolean = this.eq(o.asInstanceOf[AnyRef]) || (o match { + case x: ResourcesParams => (this.targets == x.targets) + case _ => false + }) + override def hashCode: Int = { + 37 * (37 * (17 + "sbt.internal.bsp.ResourcesParams".##) + targets.##) + } + override def toString: String = { + "ResourcesParams(" + targets + ")" + } + private[this] def copy(targets: Vector[sbt.internal.bsp.BuildTargetIdentifier] = targets): ResourcesParams = { + new ResourcesParams(targets) + } + def withTargets(targets: Vector[sbt.internal.bsp.BuildTargetIdentifier]): ResourcesParams = { + copy(targets = targets) + } +} +object ResourcesParams { + + def apply(targets: Vector[sbt.internal.bsp.BuildTargetIdentifier]): ResourcesParams = new ResourcesParams(targets) +} diff --git a/protocol/src/main/contraband-scala/sbt/internal/bsp/ResourcesResult.scala b/protocol/src/main/contraband-scala/sbt/internal/bsp/ResourcesResult.scala new file mode 100644 index 000000000..ac6063d13 --- /dev/null +++ b/protocol/src/main/contraband-scala/sbt/internal/bsp/ResourcesResult.scala @@ -0,0 +1,33 @@ +/** + * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + */ + +// DO NOT EDIT MANUALLY +package sbt.internal.bsp +/** Build Target Resources response */ +final class ResourcesResult private ( + val items: Vector[sbt.internal.bsp.ResourcesItem]) extends Serializable { + + + + override def equals(o: Any): Boolean = this.eq(o.asInstanceOf[AnyRef]) || (o match { + case x: ResourcesResult => (this.items == x.items) + case _ => false + }) + override def hashCode: Int = { + 37 * (37 * (17 + "sbt.internal.bsp.ResourcesResult".##) + items.##) + } + override def toString: String = { + "ResourcesResult(" + items + ")" + } + private[this] def copy(items: Vector[sbt.internal.bsp.ResourcesItem] = items): ResourcesResult = { + new ResourcesResult(items) + } + def withItems(items: Vector[sbt.internal.bsp.ResourcesItem]): ResourcesResult = { + copy(items = items) + } +} +object ResourcesResult { + + def apply(items: Vector[sbt.internal.bsp.ResourcesItem]): ResourcesResult = new ResourcesResult(items) +} diff --git a/protocol/src/main/contraband-scala/sbt/internal/bsp/codec/JsonProtocol.scala b/protocol/src/main/contraband-scala/sbt/internal/bsp/codec/JsonProtocol.scala index a5fd68958..6f606599f 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/bsp/codec/JsonProtocol.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/bsp/codec/JsonProtocol.scala @@ -57,4 +57,7 @@ trait JsonProtocol extends sjsonnew.BasicJsonProtocol with sbt.internal.bsp.codec.ScalaMainClassFormats with sbt.internal.bsp.codec.ScalaMainClassesItemFormats with sbt.internal.bsp.codec.ScalaMainClassesResultFormats + with sbt.internal.bsp.codec.ResourcesParamsFormats + with sbt.internal.bsp.codec.ResourcesItemFormats + with sbt.internal.bsp.codec.ResourcesResultFormats object JsonProtocol extends JsonProtocol \ No newline at end of file diff --git a/protocol/src/main/contraband-scala/sbt/internal/bsp/codec/ResourcesItemFormats.scala b/protocol/src/main/contraband-scala/sbt/internal/bsp/codec/ResourcesItemFormats.scala new file mode 100644 index 000000000..5852c98a9 --- /dev/null +++ b/protocol/src/main/contraband-scala/sbt/internal/bsp/codec/ResourcesItemFormats.scala @@ -0,0 +1,29 @@ +/** + * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + */ + +// DO NOT EDIT MANUALLY +package sbt.internal.bsp.codec +import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError } +trait ResourcesItemFormats { self: sbt.internal.bsp.codec.BuildTargetIdentifierFormats with sjsonnew.BasicJsonProtocol => +implicit lazy val ResourcesItemFormat: JsonFormat[sbt.internal.bsp.ResourcesItem] = new JsonFormat[sbt.internal.bsp.ResourcesItem] { + override def read[J](__jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.internal.bsp.ResourcesItem = { + __jsOpt match { + case Some(__js) => + unbuilder.beginObject(__js) + val target = unbuilder.readField[sbt.internal.bsp.BuildTargetIdentifier]("target") + val resources = unbuilder.readField[Vector[java.net.URI]]("resources") + unbuilder.endObject() + sbt.internal.bsp.ResourcesItem(target, resources) + case None => + deserializationError("Expected JsObject but found None") + } + } + override def write[J](obj: sbt.internal.bsp.ResourcesItem, builder: Builder[J]): Unit = { + builder.beginObject() + builder.addField("target", obj.target) + builder.addField("resources", obj.resources) + builder.endObject() + } +} +} diff --git a/protocol/src/main/contraband-scala/sbt/internal/bsp/codec/ResourcesParamsFormats.scala b/protocol/src/main/contraband-scala/sbt/internal/bsp/codec/ResourcesParamsFormats.scala new file mode 100644 index 000000000..1f07a52b3 --- /dev/null +++ b/protocol/src/main/contraband-scala/sbt/internal/bsp/codec/ResourcesParamsFormats.scala @@ -0,0 +1,27 @@ +/** + * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + */ + +// DO NOT EDIT MANUALLY +package sbt.internal.bsp.codec +import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError } +trait ResourcesParamsFormats { self: sbt.internal.bsp.codec.BuildTargetIdentifierFormats with sjsonnew.BasicJsonProtocol => +implicit lazy val ResourcesParamsFormat: JsonFormat[sbt.internal.bsp.ResourcesParams] = new JsonFormat[sbt.internal.bsp.ResourcesParams] { + override def read[J](__jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.internal.bsp.ResourcesParams = { + __jsOpt match { + case Some(__js) => + unbuilder.beginObject(__js) + val targets = unbuilder.readField[Vector[sbt.internal.bsp.BuildTargetIdentifier]]("targets") + unbuilder.endObject() + sbt.internal.bsp.ResourcesParams(targets) + case None => + deserializationError("Expected JsObject but found None") + } + } + override def write[J](obj: sbt.internal.bsp.ResourcesParams, builder: Builder[J]): Unit = { + builder.beginObject() + builder.addField("targets", obj.targets) + builder.endObject() + } +} +} diff --git a/protocol/src/main/contraband-scala/sbt/internal/bsp/codec/ResourcesResultFormats.scala b/protocol/src/main/contraband-scala/sbt/internal/bsp/codec/ResourcesResultFormats.scala new file mode 100644 index 000000000..6add5e459 --- /dev/null +++ b/protocol/src/main/contraband-scala/sbt/internal/bsp/codec/ResourcesResultFormats.scala @@ -0,0 +1,27 @@ +/** + * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + */ + +// DO NOT EDIT MANUALLY +package sbt.internal.bsp.codec +import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError } +trait ResourcesResultFormats { self: sbt.internal.bsp.codec.ResourcesItemFormats with sjsonnew.BasicJsonProtocol => +implicit lazy val ResourcesResultFormat: JsonFormat[sbt.internal.bsp.ResourcesResult] = new JsonFormat[sbt.internal.bsp.ResourcesResult] { + override def read[J](__jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.internal.bsp.ResourcesResult = { + __jsOpt match { + case Some(__js) => + unbuilder.beginObject(__js) + val items = unbuilder.readField[Vector[sbt.internal.bsp.ResourcesItem]]("items") + unbuilder.endObject() + sbt.internal.bsp.ResourcesResult(items) + case None => + deserializationError("Expected JsObject but found None") + } + } + override def write[J](obj: sbt.internal.bsp.ResourcesResult, builder: Builder[J]): Unit = { + builder.beginObject() + builder.addField("items", obj.items) + builder.endObject() + } +} +} diff --git a/protocol/src/main/contraband/bsp.contra b/protocol/src/main/contraband/bsp.contra index 4741cb738..568330499 100644 --- a/protocol/src/main/contraband/bsp.contra +++ b/protocol/src/main/contraband/bsp.contra @@ -342,11 +342,11 @@ type TaskFinishParams { type CompileParams { ## A sequence of build targets to compile targets: [sbt.internal.bsp.BuildTargetIdentifier] - + ## An optional unique identifier generated by the client to identify this request. ## The server may include this id in triggered notifications or response. originId: String - + ## Optional arguments to the compilation process arguments: [String] } @@ -355,7 +355,7 @@ type CompileParams { type BspCompileResult { ## An optional request id to know the origin of this report. originId: String - + ## A status code for the execution. statusCode: Int! @@ -635,3 +635,20 @@ type ScalaMainClass { ## Additional environment variables for the application. environmentVariables: [String] } + +# Resources Param + +type ResourcesParams { + targets: [sbt.internal.bsp.BuildTargetIdentifier] +} + +## Build Target Resources response +type ResourcesResult { + items: [sbt.internal.bsp.ResourcesItem] +} + +type ResourcesItem { + target: sbt.internal.bsp.BuildTargetIdentifier! + ## List of resource files. + resources: [java.net.URI] +}