diff --git a/modules/core/src/main/scala/playground/DynamicServiceProxy.scala b/modules/core/src/main/scala/playground/DynamicServiceProxy.scala index 35209c54..b5e15479 100644 --- a/modules/core/src/main/scala/playground/DynamicServiceProxy.scala +++ b/modules/core/src/main/scala/playground/DynamicServiceProxy.scala @@ -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 { diff --git a/modules/core/src/main/scala/playground/OperationCompiler.scala b/modules/core/src/main/scala/playground/OperationCompiler.scala index 1a76e58b..631d34a8 100644 --- a/modules/core/src/main/scala/playground/OperationCompiler.scala +++ b/modules/core/src/main/scala/playground/OperationCompiler.scala @@ -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] @@ -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 diff --git a/modules/core/src/main/scala/playground/OperationRunner.scala b/modules/core/src/main/scala/playground/OperationRunner.scala index 82b4f9a0..ed018e0c 100644 --- a/modules/core/src/main/scala/playground/OperationRunner.scala +++ b/modules/core/src/main/scala/playground/OperationRunner.scala @@ -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, diff --git a/modules/core/src/test/scala/playground/DynamicModel.scala b/modules/core/src/test/scala/playground/DynamicModel.scala index 926e7967..543bb2f9 100644 --- a/modules/core/src/test/scala/playground/DynamicModel.scala +++ b/modules/core/src/test/scala/playground/DynamicModel.scala @@ -13,7 +13,7 @@ object DynamicModel { .assemble() .unwrap() - DynamicSchemaIndex.loadModel(model).toTry.get + DynamicSchemaIndex.loadModel(model) } } diff --git a/modules/language-support/src/main/scala/playground/language/CompletionProvider.scala b/modules/language-support/src/main/scala/playground/language/CompletionProvider.scala index e8c2b4d9..8740b3d2 100644 --- a/modules/language-support/src/main/scala/playground/language/CompletionProvider.scala +++ b/modules/language-support/src/main/scala/playground/language/CompletionProvider.scala @@ -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] diff --git a/modules/lsp/src/main/scala/playground/lsp/BuildLoader.scala b/modules/lsp/src/main/scala/playground/lsp/BuildLoader.scala index 9231e7f9..e58f8f65 100644 --- a/modules/lsp/src/main/scala/playground/lsp/BuildLoader.scala +++ b/modules/lsp/src/main/scala/playground/lsp/BuildLoader.scala @@ -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 } diff --git a/modules/lsp/src/main/scala/playground/lsp/LanguageServer.scala b/modules/lsp/src/main/scala/playground/lsp/LanguageServer.scala index add0d3bc..9565417e 100644 --- a/modules/lsp/src/main/scala/playground/lsp/LanguageServer.scala +++ b/modules/lsp/src/main/scala/playground/lsp/LanguageServer.scala @@ -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( diff --git a/modules/lsp/src/main/scala/playground/lsp/ServerBuilder.scala b/modules/lsp/src/main/scala/playground/lsp/ServerBuilder.scala index fa6a8513..914a15ae 100644 --- a/modules/lsp/src/main/scala/playground/lsp/ServerBuilder.scala +++ b/modules/lsp/src/main/scala/playground/lsp/ServerBuilder.scala @@ -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 diff --git a/project/plugins.sbt b/project/plugins.sbt index 51cc09bc..d567f85d 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -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")