Skip to content

Commit

Permalink
Update to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Oct 2, 2023
1 parent 109918b commit c20c060
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ class DynamicServiceProxy[Alg[_[_, _, _, _, _]], Op[_, _, _, _, _]](
val mapOutput = makeProxy(endpointStatic.output, endpoint.output)

def errorMapper[A]: Throwable => F[A] =
endpointStatic.errorable match {
endpointStatic.error match {
case None => _.raiseError[F, A]
case Some(errorableStatic) =>
val errorable = endpoint.errorable.get // should be there at this point
val mapError = makeProxy(errorableStatic.error, errorable.error)
val errorable = endpoint.error.get // should be there at this point
val mapError = makeProxy(errorableStatic.schema, errorable.schema)

e =>
errorableStatic.liftError(e) match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ object OperationCompiler {

def fromSchemaIndex(
dsi: DynamicSchemaIndex
): OperationCompiler[Eff] = fromServices(dsi.allServices)
): OperationCompiler[Eff] = fromServices(dsi.allServices.toList)

def fromServices(
services: List[DynamicSchemaIndex.ServiceWrapper]
Expand Down Expand Up @@ -154,7 +154,7 @@ private class ServiceCompiler[Alg[_[_, _, _, _, _]]](
): QueryCompiler[CompiledInput] = {
val inputCompiler = e.input.compile(QueryCompilerVisitor.full)
val outputEncoder = NodeEncoder.derive(e.output)
val errorEncoder = e.errorable.map(e => NodeEncoder.derive(e.error))
val errorEncoder = e.error.map(e => NodeEncoder.derive(e.schema))

ast =>
inputCompiler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ object OperationRunner {
awsEnv: Resource[F, AwsEnvironment[F]],
plugins: List[PlaygroundPlugin],
): Map[QualifiedIdentifier, Resolver[F]] = forServices(
services = dsi.allServices,
services = dsi.allServices.toList,
getSchema = dsi.getSchema,
client = client,
baseUri = baseUri,
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/test/scala/playground/DynamicModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object DynamicModel {
.assemble()
.unwrap()

DynamicSchemaIndex.loadModel(model).toTry.get
DynamicSchemaIndex.loadModel(model)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object CompletionProvider {

def forSchemaIndex(
dsi: DynamicSchemaIndex
): CompletionProvider = forServices(dsi.allServices)
): CompletionProvider = forServices(dsi.allServices.toList)

def forServices(
allServices: List[DynamicSchemaIndex.ServiceWrapper]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ object BuildLoader {
for {
specs <- filterImports(rawImportPaths)
model <- loadModel(specs, loaded.config)
dsi <- DynamicSchemaIndex.loadModel(model).liftTo[F]
dsi = DynamicSchemaIndex.loadModel(model)
} yield dsi
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ object LanguageServer {

// see if we can pass this everywhere
// https://github.com/kubukoz/smithy-playground/issues/164
val serviceIndex: ServiceIndex = ServiceIndex.fromServices(dsi.allServices)
val serviceIndex: ServiceIndex = ServiceIndex.fromServices(dsi.allServices.toList)

val compiler: FileCompiler[IorThrow] = FileCompiler
.instance(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ object ServerBuilder {
plugins = plugins,
)

val serviceIndex = ServiceIndex.fromServices(dsi.allServices)
val serviceIndex = ServiceIndex.fromServices(dsi.allServices.toList)

implicit val sl: ServerLoader[F] = loader

Expand Down
3 changes: 2 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml"
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.3")

addSbtPlugin("com.disneystreaming.smithy4s" % "smithy4s-sbt-codegen" % "0.18.0-945-9e50924")
//7b21e56392480baa1b9183ef154846d6121ebae2
addSbtPlugin("com.disneystreaming.smithy4s" % "smithy4s-sbt-codegen" % "dev-SNAPSHOT")

addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.1")
Expand Down

0 comments on commit c20c060

Please sign in to comment.